diff options
author | Michel Bardiaux <mbardiaux@peaktime.be> | 2007-02-01 09:45:05 +0000 |
---|---|---|
committer | Panagiotis Issaris <takis.issaris@uhasselt.be> | 2007-02-01 09:45:05 +0000 |
commit | 65d999d6cfc4190f26156a0878d1599d9085c7e9 (patch) | |
tree | c6adff39561cf2fa4955d0453d6152511b2fa29b /libavcodec/utils.c | |
parent | 541184974ca11be6a7bb6fc4ff4ed804de62b524 (diff) | |
download | ffmpeg-streaming-65d999d6cfc4190f26156a0878d1599d9085c7e9.zip ffmpeg-streaming-65d999d6cfc4190f26156a0878d1599d9085c7e9.tar.gz |
Activate guards in avcodec_default_get_buffer. Patch by Michel Bardiaux,
mbardiaux mediaxim dot be.
Originally committed as revision 7794 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index f6f0613..f61fbdb 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -237,8 +237,14 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ InternalBuffer *buf; int *picture_number; - assert(pic->data[0]==NULL); - assert(INTERNAL_BUFFER_SIZE > s->internal_buffer_count); + if(pic->data[0]!=NULL) { + av_log(s, AV_LOG_ERROR, "pic->data[0]!=NULL in avcodec_default_get_buffer\n"); + return -1; + } + if(s->internal_buffer_count >= INTERNAL_BUFFER_SIZE) { + av_log(s, AV_LOG_ERROR, "internal_buffer_count overflow (missing release_buffer?)\n"); + return -1; + } if(avcodec_check_dimensions(s,w,h)) return -1; |