vda: check allocation result.
authorSebastien Zwickert <dilaroga@free.fr>
Mon, 14 Nov 2011 20:56:16 +0000 (21:56 +0100)
committerSebastien Zwickert <dilaroga@free.fr>
Mon, 14 Nov 2011 21:24:03 +0000 (22:24 +0100)
libavcodec/vda.c

index 4675e0b..ade961e 100644 (file)
@@ -125,6 +125,9 @@ static void vda_decoder_callback (void *vda_hw_ctx,
         return;
 
     new_frame = av_mallocz(sizeof(vda_frame));
+    if (!new_frame)
+        return;
+
     new_frame->next_frame = NULL;
     new_frame->cv_buffer = CVPixelBufferRetain(image_buffer);
     new_frame->pts = vda_pts_from_dictionary(user_info);