最近调用了一个第三方的API,在长期使用过程中,发现有很低概率的出现内存访问错误.
导致系统崩溃,虽然能使用TRY结构捕捉到错误,但还是不能将系统恢复正常.
API的调用方式:
function avcodec_decode_video (avctx: PAVCodecContext; picture: PAVFrame;
                         got_picture_ptr: PInteger;
                         const buf: PByte; buf_size: int): int;
  cdecl; external dll_name;错误日志:avcodec_decode_video EAccessViolationAccess violation at address 00651C07 in module 'Monitor.exe'. Read of address 29B84B11const buf: PByte; buf_size: int
这两个函数,是经常变化的.目前的解决思路是尽量避免参数非法,防止出错.
希望能从根本上处理这样的错误,delphi下,不知道该如何处理,请指点一二.
谢谢@!