[FFmpeg-cvslog] avcodec/mpeg12dec: Don't pretend MPEG-1/2 to support alpha

Andreas Rheinhardt git at videolan.org
Mon Apr 8 16:18:28 EEST 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Apr  5 06:06:17 2024 +0200| [518f79f2a83d07f8917e5acda794f0481a93e2d4] | committer: Andreas Rheinhardt

avcodec/mpeg12dec: Don't pretend MPEG-1/2 to support alpha

(FF_PTR_ADD has to be kept although MPEG-1/2 only supports
YUV pixel formats because our decoder also supports decoding
to AV_PIX_FMT_GRAY8 depending upon CONFIG_GRAY.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/mpeg12dec.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 83ff40d237..337654c88d 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1303,7 +1303,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
             s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST *
                                                 (s->picture_structure == PICT_TOP_FIELD);
 
-            for (int i = 0; i < 4; i++) {
+            for (int i = 0; i < 3; i++) {
                 if (s->picture_structure == PICT_BOTTOM_FIELD) {
                     s->current_picture.f->data[i] = FF_PTR_ADD(s->current_picture.f->data[i],
                                                                s->current_picture.f->linesize[i]);
@@ -1368,8 +1368,6 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
         if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME))
             ff_thread_finish_setup(avctx);
     } else { // second field
-        int i;
-
         if (!s->current_picture_ptr) {
             av_log(s->avctx, AV_LOG_ERROR, "first field missing\n");
             return AVERROR_INVALIDDATA;
@@ -1383,7 +1381,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
             }
         }
 
-        for (i = 0; i < 4; i++) {
+        for (int i = 0; i < 3; i++) {
             s->current_picture.f->data[i] = s->current_picture_ptr->f->data[i];
             if (s->picture_structure == PICT_BOTTOM_FIELD)
                 s->current_picture.f->data[i] +=



More information about the ffmpeg-cvslog mailing list