访问冲突问题

Saltedefish 2021-04-14 03:36:11
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);
}
...全文
1020 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
待续_1006 2021-04-21
  • 打赏
  • 举报
回复
Number_Pixel_Inside += Array_Hist[i]; //此处是问题断点 99%的原因是访问越界,调试查看自己的数据吧
bluesen 2021-04-14
  • 打赏
  • 举报
回复
多半是Array_Hist越界了,或者在调用本函数之前就破坏了内存。
没什么捷径,一步步调试

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧