avcodec/mpegvideo_dec: Fix UB NULL + 0

Affected the mpeg2-field-enc FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-09-28 20:04:54 +02:00
parent 63b3156558
commit 04196852a2
1 changed files with 2 additions and 2 deletions

View File

@ -446,8 +446,8 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
if (s->picture_structure != PICT_FRAME) {
for (int i = 0; i < 4; i++) {
if (s->picture_structure == PICT_BOTTOM_FIELD) {
s->current_picture.f->data[i] +=
s->current_picture.f->linesize[i];
s->current_picture.f->data[i] = FF_PTR_ADD(s->current_picture.f->data[i],
s->current_picture.f->linesize[i]);
}
s->current_picture.f->linesize[i] *= 2;
s->last_picture.f->linesize[i] *= 2;