avcodec/vda_h264: fix null pointer dereference
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 12 May 2014 00:25:58 +0000 (02:25 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 12 May 2014 00:25:58 +0000 (02:25 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vda_h264.c

index 2bb45c3..4caed5e 100644 (file)
@@ -274,9 +274,11 @@ int ff_vda_destroy_decoder(struct vda_context *vda_ctx)
 static int vda_h264_uninit(AVCodecContext *avctx)
 {
     VDAContext *vda = avctx->internal->hwaccel_priv_data;
-    av_freep(&vda->bitstream);
-    if (vda->frame)
-        CVPixelBufferRelease(vda->frame);
+    if (vda) {
+        av_freep(&vda->bitstream);
+        if (vda->frame)
+            CVPixelBufferRelease(vda->frame);
+    }
     return 0;
 }