diff options
author | Mike Melanson <mike@multimedia.cx> | 2006-08-02 07:02:37 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2006-08-02 07:02:37 +0000 |
commit | 5f24c84bddd59e2d1744408f2c3694050d7d3d3d (patch) | |
tree | 044d31ff791ca6d0d60b5624bd31554f7da53876 /src/libffmpeg/libavcodec/4xm.c | |
parent | feaf0357aaa9f80562900ad9c50b9adf44d9b795 (diff) | |
download | xine-lib-5f24c84bddd59e2d1744408f2c3694050d7d3d3d.tar.gz xine-lib-5f24c84bddd59e2d1744408f2c3694050d7d3d3d.tar.bz2 |
sync to FFmpeg 51.11.0
CVS patchset: 8146
CVS date: 2006/08/02 07:02:37
Diffstat (limited to 'src/libffmpeg/libavcodec/4xm.c')
-rw-r--r-- | src/libffmpeg/libavcodec/4xm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libffmpeg/libavcodec/4xm.c b/src/libffmpeg/libavcodec/4xm.c index 3ca2338d2..a986f151e 100644 --- a/src/libffmpeg/libavcodec/4xm.c +++ b/src/libffmpeg/libavcodec/4xm.c @@ -606,7 +606,7 @@ static int decode_frame(AVCodecContext *avctx, int i, frame_4cc, frame_size; frame_4cc= get32(buf); - if(buf_size != get32(buf+4)+8){ + if(buf_size != get32(buf+4)+8 || buf_size < 20){ av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n", buf_size, get32(buf+4)); } @@ -634,6 +634,10 @@ static int decode_frame(AVCodecContext *avctx, cfrm= &f->cfrm[i]; cfrm->data= av_fast_realloc(cfrm->data, &cfrm->allocated_size, cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE); + if(!cfrm->data){ //explicit check needed as memcpy below might not catch a NULL + av_log(f->avctx, AV_LOG_ERROR, "realloc falure"); + return -1; + } memcpy(cfrm->data + cfrm->size, buf+20, data_size); cfrm->size += data_size; |