diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-11 23:52:55 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-14 04:55:15 +0100 |
commit | 44e191457a1268a8112ec7b35cf18de2957123b3 (patch) | |
tree | abecb3b749db3fdae1399b5546aacf8723ede042 /libavcodec/utils.c | |
parent | 2422e8271c8fc3055a9844e64d232e5135826a4a (diff) | |
download | ffmpeg-44e191457a1268a8112ec7b35cf18de2957123b3.tar.gz |
utils: check that parameters havnt changed in reget_buffer()
Fixes Ticket902
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 78bc6e7626..91c5e43c2e 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -557,6 +557,11 @@ int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic){ assert(s->codec_type == AVMEDIA_TYPE_VIDEO); + if (pic->data[0] && (pic->width != s->width || pic->height != s->height || pic->format != s->pix_fmt)) { + av_log(s, AV_LOG_WARNING, "Width/height/fmt changing with reget buffer"); + s->release_buffer(s, pic); + } + /* If no picture return a new buffer */ if(pic->data[0] == NULL) { /* We will copy from buffer, so must be readable */ |