Avoid a null pointer dereference after oom on frame size change in mpegvideo.c.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 30 Jun 2013 21:45:37 +0000 (23:45 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 30 Jun 2013 21:45:37 +0000 (23:45 +0200)
Fixes ticket #2735.

libavcodec/mpegvideo.c

index 6e5162b..0871489 100644 (file)
@@ -1223,7 +1223,8 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s)
                         (s->mb_height * (i + 1) + nb_slices / 2) / nb_slices;
             }
         } else {
-            if (init_duplicate_context(s) < 0)
+            err = init_duplicate_context(s);
+            if (err < 0)
                 goto fail;
             s->start_mb_y = 0;
             s->end_mb_y   = s->mb_height;