summaryrefslogtreecommitdiff
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-01 14:06:33 +0200
commit4863671d888273392e9dcc2429f3852c00330498 (patch)
tree48b9ac4508e7c377009ee1516f8f06eb8236bb33
parent9eadd616b7ec31f9a6b691ff3faa2c6c3716335f (diff)
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>
-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 81f832fe4b..46a266e125 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);