ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Sat Oct  7 19:16:49 2023 +0200| [042117da75308f3d96df85ea4f97864d0142af3d] | 
committer: Andreas Rheinhardt

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.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=042117da75308f3d96df85ea4f97864d0142af3d
---

 libavcodec/mpegpicture.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

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

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to