Unhandled exception at 0x........ in XXXX.exe: 0xC0000005:错误
第一件事,检查下你传入的参数是否合法;
第二件事,若malloc了一块内存,必须记得free;
第三件事,你是否赋值了已经溢出的值或地址。
- pOrg = pcPicYuvOrg->getLumaAddr();
- for( y = 0; y < height-1; y++ )
- {
- for( x = 0; x < width-1; x++ )
- {
- Pel A[4];
- //2x2
- A[0]=pOrg[x]; A[1]=pOrg[x+1];
- A[2]=(pOrg+stride)[x]; A[3]=(pOrg+stride)[x+1];
- if( A[0]==255 && A[1]==255 && A[2]==255 && A[3]==255 )
- {
- pOrg[x] = 255; pOrg[x+1] = 255;
- (pOrg+stride)[x] = 255; (pOrg+stride)[x+1] = 255;
- }
- else
- {
- pOrg[x] = 0; pOrg[x+1] = 0;
- (pOrg+stride)[x] = 0; (pOrg+stride)[x+1] = 0;
- }
- x += 1;
- }
- pOrg += 2*stride;
- }
此代码就会出现上图所示错误。那么如何解决呢?
- pOrg = pcPicYuvOrg->getLumaAddr();
- for( y = 0; y < height/2; y++ )
- {
- for( x = 0; x < width-1; x++ )
- {
- Pel A[4];
- //2x2
- A[0]=pOrg[x]; A[1]=pOrg[x+1];
- A[2]=(pOrg+stride)[x]; A[3]=(pOrg+stride)[x+1];
- if( A[0]==255 && A[1]==255 && A[2]==255 && A[3]==255 )
- {
- pOrg[x] = 255; pOrg[x+1] = 255;
- (pOrg+stride)[x] = 255; (pOrg+stride)[x+1] = 255;
- }
- else
- {
- pOrg[x] = 0; pOrg[x+1] = 0;
- (pOrg+stride)[x] = 0; (pOrg+stride)[x+1] = 0;
- }
- x += 1;
- }
- pOrg += 2*stride;
- }
很明显,错误的原因在于:赋值了已经溢出的值。
Unhandled exception at 0x........ in XXXX.exe: 0xC0000005:错误的更多相关文章
- Solve Error: Unhandled exception at 0x00905a4d in xxx.exe: 0xC0000005: Access violation.
在使用Visual Studio进行项目开发的时候,有时候会遇到下面这个错误: Unhandled exception at 0x00905a4d in xxx.exe: 0xC0000005: Ac ...
- NET环境下的未处理异常(unhandled exception)的解决方案
NET环境下的未处理异常(unhandled exception )的解决方案 .Net 框架提供了非常强大的异常处理机制,同时对一些非托管代码很难控制的系统问题比如指针越界,内存泄漏等提供了很好的解 ...
- [转]让程序在崩溃时体面的退出之Unhandled Exception
原文地址:http://blog.csdn.net/starlee/article/details/6613424 程序是由代码编译出来的,而代码是由人写的.人非圣贤,孰能无过.所以由人写的代码有缺陷 ...
- Unhandled Exception: System.BadImageFormatException: Could not load file or assembly (2008R2配置x64website)
.NET Error Message: Unhandled Exception: System.BadImageFormatException: Could not load file or asse ...
- Unhandled Exception:System.DllNotFoundException: Unable to load DLL"**":找不到指定的模块
在项目中使用C#代码调用C++ DLL时.常常会出现这个问题:在开发者自己的电脑上运行没有问题,但是部署到客户电脑上时会出现下面问题: Unhandled Exception:System.DllNo ...
- android Unhandled exception type ParseException提示报错
Unhandled exception type ParseException 意思指:你有一个方法会抛出异常,但是你没有捕捉. 依提示添加一下即可解决:
- JAVA 新手问题: Request 编码编译出错,Unhandled exception type UnsupportedEncodingException
新手: 编写如下代码 private void Exec(HttpServletRequest Req,HttpServletResponse Response) //throws ServletEx ...
- Quartz:ERROR threw an unhandled Exception
详细的错误信息如下: -- ::] ERROR org.quartz.core.JobRunShell: - Job group1.job1 threw an unhandled Exception: ...
- Unhandled Exxception “Unhandled exception type IOException”?
Unhandled Exxception “Unhandled exception type IOException”? 在Android studio中,自动遇见这个异常报错,如果eclipse会 ...
随机推荐
- Ruff is in the house
Ruff is in my home. 浦东的一家小厂出产的开发板,让我可以用万能的JS开发. 等下试试它的树莓派SDK. 新的时代,旧的东西在被慢慢改进.只要有一颗想动手捣鼓的心,自然会找到合适的工 ...
- 如何解决sublime text 2总是在新窗口中打开文件及文件夹
如何在原窗口打开文件 具体设置:Preferences -> Settings – Default -> 搜索open_files_in_new_window,将其true 改为 fals ...
- img的绝对路径转为相对路径
$('#add_img').on('change', function(){ var objUrl = getObjectURL(this.files[0]) ; if (objUrl) { $(th ...
- iOS - Localizable 国际化
1.国际化 开发的移动应用更希望获取更多用户,走向世界,这就需要应用国际化,国际化其实就是多语言,系统会根据当前设备的语言环境来识别 App 中使用中文还是英文. 2.应用内容国际化 1.新建一个名为 ...
- TC250专场
SRM 623 DIV2 1000pt 题意:给出一个最多50*50的矩阵,每个单元可能为'.'.'P'.'A','.'代表空地,你每次操作可以把一个P或者A拿到空地上,求一个最大的含有相同字符的矩形 ...
- OAM
OAM -- Operation Administration and Maintenance[ˈmentənəns]. 根据运营商网络运营的实际需要,通常将网络的管理工作划分为3大类:操作(Oper ...
- NPOI的使用Excel模板导出
private string ExportScMeeting(DataTable source) { string templateFile = Server.MapPath(@"Excel ...
- HAOI2012音量调节
Description 一个吉他手准备参加一场演出.他不喜欢在演出时始终使用同一个音量,所以他决定每一首歌之前他都要改变一次音量.在演出开始之前,他已经做好了一个列表,里面写着在每首歌开始之前他想要改 ...
- 在重新生成解决方案时,出现的错误:无法将文件“obj\x86\Debug\*.exe”复制到“obj\Debug\*.exe”。文件正由另一进程使用,因此该进程无法访问此文件
此例是VS2010的CS项目. 在重新生成解决方案时,出现的错误. 解决步骤:先关闭解决方案,再在项目文件下的bin\Debug\*.exe删除这类之前生成得.exe文件,再在VS2010下重新生成.
- DPDK编译步骤
大页内存分配: NUMA系统(现在的linux一般都是) echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048 ...