aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-03-26 07:15:56 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-02 21:39:37 +0200
commit09510d9ffd91d1b734d8099884dfb916069b4f2e (patch)
treef3e020744bcebf70611d0d3d4eac1cbea897ee61
parent816d4bee4a4d103cde4011517b33122990ce6730 (diff)
downloadffmpeg-09510d9ffd91d1b734d8099884dfb916069b4f2e.tar.gz
avcodec/mpegvideo_enc: Don't apply non-zero offset to null pointer
Affected many FATE tests (mostly vsynth ones). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit 4863671d888273392e9dcc2429f3852c00330498)
-rw-r--r--libavcodec/mpegvideo_enc.c3
1 files changed, 2 insertions, 1 deletions
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);