vp9: don't retain NULL as segmentation_map
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Wed, 17 Jun 2015 17:02:15 +0000 (19:02 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 19 Jun 2015 16:40:49 +0000 (18:40 +0200)
This fixes segmentation faults, which were introduced in commit
4ba8f327.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit d216b9debd9843d31732ebb7344a85b3cd96b7cc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vp9.c

index d5147e5..b9d207a 100644 (file)
@@ -3988,7 +3988,8 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
     int size = pkt->size;
     VP9Context *s = ctx->priv_data;
     int res, tile_row, tile_col, i, ref, row, col;
-    int retain_segmap_ref = s->segmentation.enabled && !s->segmentation.update_map;
+    int retain_segmap_ref = s->segmentation.enabled && !s->segmentation.update_map
+                            && s->frames[REF_FRAME_SEGMAP].segmentation_map;
     ptrdiff_t yoff, uvoff, ls_y, ls_uv;
     AVFrame *f;
     int bytesperpixel;