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 */