访问冲突问题
0x000000013f4f3fd9 处有未经处理的异常: 0xC0000005: 读取位置 0x0000000140153c6c 时发生访问冲突,就一个简单的加法运算,什么都没做。Array_Hist是unsigned int 类型数组传递过来的首地址指针,数组是没问题的,因为这个函数之前也用这个数组做了直方图统计
unsigned short PlayBack1Calculate::CalGlayMax(unsigned int* Array_Hist,unsigned short Number_Pixel)
{
unsigned int Number_Pixel_Inside = 0;
//Number_Pixel_Inside = 0;
for(int i = IMAGE_LEN - 1;i > 0;i--)
{
Number_Pixel_Inside += Array_Hist[i]; //此处是问题断点
if(Number_Pixel_Inside >= Number_Pixel)
{
return ((unsigned short)i);
}
}
return ((unsigned short)0);
}