History

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.

Andreas Rheinhardt committed 3 years ago

Commit 042117d1 parent 8c59b5a1 file · +5 −6Browse files

Unified · Split

libavcodec/mpegpicture.c+5−6
@@ -102,20 +102,19 @@ static int handle_pic_linesizes(AVCodecContext *avctx, Picture *pic, · 101 unmodified lines
102 102
103 if ((linesize && linesize != pic->f->linesize[0]) ||103 if ((linesize && linesize != pic->f->linesize[0]) ||
104 (uvlinesize && uvlinesize != pic->f->linesize[1])) {104 (uvlinesize && uvlinesize != pic->f->linesize[1])) {
105 av_log(avctx, AV_LOG_ERROR,105 av_log(avctx, AV_LOG_ERROR, "Stride change unsupported: "
106 "get_buffer() failed (stride changed: linesize=%d/%d uvlinesize=%d/%d)\n",106 "linesize=%d/%d uvlinesize=%d/%d)\n",
107 linesize, pic->f->linesize[0],107 linesize, pic->f->linesize[0],
108 uvlinesize, pic->f->linesize[1]);108 uvlinesize, pic->f->linesize[1]);
109 ff_mpeg_unref_picture(pic);109 ff_mpeg_unref_picture(pic);
110 return -1;110 return AVERROR_PATCHWELCOME;
111 }111 }
112 112
113 if (av_pix_fmt_count_planes(pic->f->format) > 2 &&113 if (av_pix_fmt_count_planes(pic->f->format) > 2 &&
114 pic->f->linesize[1] != pic->f->linesize[2]) {114 pic->f->linesize[1] != pic->f->linesize[2]) {
115 av_log(avctx, AV_LOG_ERROR,115 av_log(avctx, AV_LOG_ERROR, "uv stride mismatch unsupported\n");
116 "get_buffer() failed (uv stride mismatch)\n");
117 ff_mpeg_unref_picture(pic);116 ff_mpeg_unref_picture(pic);
118 return -1;117 return AVERROR_PATCHWELCOME;
119 }118 }
120 119
121 ret = ff_mpeg_framesize_alloc(avctx, me, sc,120 ret = ff_mpeg_framesize_alloc(avctx, me, sc,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t