Saltedefish 2021-04-14 15:46 采纳率: 37.5%
浏览 27
已采纳

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);
}

  • 写回答

3条回答 默认 最新

  • 关注

    Array_Hist[i],这个i会不会数组越界了呢?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?