avcodec/mpegpicture: Improve error messages and code

Make it clear that this is not a failure of get_buffer/the user,
but a deficit of mpegvideo.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-10-07 19:16:49 +02:00
parent 8c59b5aa6b
commit 042117da75
1 changed files with 5 additions and 6 deletions

View File

@ -102,20 +102,19 @@ static int handle_pic_linesizes(AVCodecContext *avctx, Picture *pic,
if ((linesize && linesize != pic->f->linesize[0]) || if ((linesize && linesize != pic->f->linesize[0]) ||
(uvlinesize && uvlinesize != pic->f->linesize[1])) { (uvlinesize && uvlinesize != pic->f->linesize[1])) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR, "Stride change unsupported: "
"get_buffer() failed (stride changed: linesize=%d/%d uvlinesize=%d/%d)\n", "linesize=%d/%d uvlinesize=%d/%d)\n",
linesize, pic->f->linesize[0], linesize, pic->f->linesize[0],
uvlinesize, pic->f->linesize[1]); uvlinesize, pic->f->linesize[1]);
ff_mpeg_unref_picture(pic); ff_mpeg_unref_picture(pic);
return -1; return AVERROR_PATCHWELCOME;
} }
if (av_pix_fmt_count_planes(pic->f->format) > 2 && if (av_pix_fmt_count_planes(pic->f->format) > 2 &&
pic->f->linesize[1] != pic->f->linesize[2]) { pic->f->linesize[1] != pic->f->linesize[2]) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR, "uv stride mismatch unsupported\n");
"get_buffer() failed (uv stride mismatch)\n");
ff_mpeg_unref_picture(pic); ff_mpeg_unref_picture(pic);
return -1; return AVERROR_PATCHWELCOME;
} }
ret = ff_mpeg_framesize_alloc(avctx, me, sc, ret = ff_mpeg_framesize_alloc(avctx, me, sc,