From 09510d9ffd91d1b734d8099884dfb916069b4f2e Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 26 Mar 2021 07:15:56 +0100 Subject: [PATCH] avcodec/mpegvideo_enc: Don't apply non-zero offset to null pointer Affected many FATE tests (mostly vsynth ones). Signed-off-by: Andreas Rheinhardt (cherry picked from commit 4863671d888273392e9dcc2429f3852c00330498) --- libavcodec/mpegvideo_enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 7eecfce27c..a095062052 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1696,7 +1696,8 @@ no_output_pic: // input is not a shared pix -> reuse buffer for current_pix s->current_picture_ptr = s->reordered_input_picture[0]; for (i = 0; i < 4; i++) { - s->new_picture.f->data[i] += INPLACE_OFFSET; + if (s->new_picture.f->data[i]) + s->new_picture.f->data[i] += INPLACE_OFFSET; } } ff_mpeg_unref_picture(s->avctx, &s->current_picture);