summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-11 23:52:55 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-14 04:55:15 +0100
commit44e191457a1268a8112ec7b35cf18de2957123b3 (patch)
treeabecb3b749db3fdae1399b5546aacf8723ede042 /libavcodec/utils.c
parent2422e8271c8fc3055a9844e64d232e5135826a4a (diff)
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.c5
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 */