mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/mpegpicture: fix "stride changed" failures in gray mode
Before adding uvlinesize check, I was seeing failures decoding some video with ffmpeg compiled with --enable-gray and using AV_CODEC_FLAG_GRAY. [mpeg2video @ 0x7fa193818c00] get_buffer() failed (stride changed: linesize=1280/1280 uvlinesize=0/640) [mpeg2video @ 0x7fa193818c00] get_buffer() failed (stride changed: linesize=1280/1280 uvlinesize=0/640) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
2108a6736f
commit
19128408ac
|
@ -148,10 +148,12 @@ static int alloc_frame_buffer(AVCodecContext *avctx, Picture *pic,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (linesize && (linesize != pic->f->linesize[0] ||
|
if ((linesize && linesize != pic->f->linesize[0]) ||
|
||||||
uvlinesize != pic->f->linesize[1])) {
|
(uvlinesize && uvlinesize != pic->f->linesize[1])) {
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"get_buffer() failed (stride changed)\n");
|
"get_buffer() failed (stride changed: linesize=%d/%d uvlinesize=%d/%d)\n",
|
||||||
|
linesize, pic->f->linesize[0],
|
||||||
|
uvlinesize, pic->f->linesize[1]);
|
||||||
ff_mpeg_unref_picture(avctx, pic);
|
ff_mpeg_unref_picture(avctx, pic);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue