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@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-04-05 06:06:17 +02:00
parent 1a5452655a
commit 518f79f2a8
1 changed files with 2 additions and 4 deletions

View File

@ -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] +=