utils: check that parameters havnt changed in reget_buffer()

Fixes Ticket902

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-01-11 23:52:55 +01:00
parent 2422e8271c
commit 44e191457a
1 changed files with 5 additions and 0 deletions

View File

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