]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mpegvideo_enc: Don't apply non-zero offset to null pointer
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 26 Mar 2021 06:15:56 +0000 (07:15 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Thu, 1 Apr 2021 12:06:33 +0000 (14:06 +0200)
Affected many FATE tests (mostly vsynth ones).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/mpegvideo_enc.c

index 81f832fe4bf41ebed676761a7bcf409ef1e4b432..46a266e12531bb27a04c812f2427cf93ce633da5 100644 (file)
@@ -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);