/*读取字符串中的字符出错(无法读取内存)*/
1、该处代码未执行(变量未初始化,赋值)
2、未正确分配内存
3、越界访问
0x00000000 处(位于 xxx.exe 中)引发的异常: 0xC0000005: 执行位置 0x00000000 时发生访问冲突。
解:导入动态库失败,指针为空(一般是写错了)
Run-Time Check Failure #3 - The variable 'loop_end' is being used without being initialized.
未初始化的指针或者空指针不能解引用,哪来的内存!
所以变量最好定义为非指针(int a),这样分配了内存,然后传参&a给函数,可以在函数内改变变量,达到函数间通信的目的
0x534E6B4E (avformat-57.dll)处(位于 xxx.exe 中)引发的异常: 0xC0000005: 读取位置 0x00000440 时发生访问冲突。
一般是指针为NULL,使用了空指针,或者是野指针,解引用了空指针,释放了空指针
==========================================================================
point_cur_loc = point_beg_loc + (nb_lines * bmp_width * 4) + (x_loc++ * 4);
cur_loc_tmp = (int32_t*)point_cur_loc;
*cur_loc_tmp = 0xFF0000;
++x_loc;
以上代码,x_loc叠加两次,导致越界,超出分配的堆内存
再次执行cur_loc_tmp = 0xFF0000;未malloc的内存被改变类型并强行赋值,导致错误;
[HEAP CORRUPTION DETECTED: after Normal block(#113) at 0x293c040.
CRT detected that the application wrote to memory after end of heap buffer.]
==========================================================================
==============================================================================================
0x73FF01D0 (msvcr100.dll) (animiz.exe 中)处有未经处理的异常: 0xC0000005: 写入位置 0x00000000 时发生访问冲突。
char* tts_parm_copy(const char *src)
{
char *dst;
dst = (char*)malloc(strlen(src) + 1);
if (dst == NULL) {
return NULL;
}
memset(dst, 0, strlen(dst) + 1);
memcpy(dst, src, strlen(src) + 1);
return dst;
}
==============================================================================================
===========================================================================================
0x776D9AAA (ntdll.dll) (tt.exe 中)处有未经处理的异常: 0xC0000374: 堆已损坏。 (参数: 0x777158E8)。
char *filename = (char*)malloc(1024);
memset(filename, 0, strlen(filename));
sprintf(filename, "%s/SP%lld.bin", path, (int64_t)av_gettime());
free(path);
============================================================================================
=====================================================================================================
0x76193952 (ucrtbase.dll) (tt.exe 中)处有未经处理的异常: 将一个无效参数传递给了将无效参数视为严重错误的函数。
log(printf)
=====================================================================================================