[vlc-commits] codec: videotoolbox: check imageBuffer from callback

Thomas Guillem git at videolan.org
Wed Sep 27 16:29:24 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Sep 27 15:12:32 2017 +0200| [b91b28c11d92a02386da103b694aa80098f55b8a] | committer: Thomas Guillem

codec: videotoolbox: check imageBuffer from callback

This should not happen, this will still assert in debug mode.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b91b28c11d92a02386da103b694aa80098f55b8a
---

 modules/codec/videotoolbox.m | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 6c7e679d87..931c20a6e9 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1599,6 +1599,12 @@ static void DecoderCallback(void *decompressionOutputRefCon,
         goto end;
     }
     assert(imageBuffer);
+    if (unlikely(!imageBuffer))
+    {
+        msg_Err(p_dec, "critical: null imageBuffer with a valid status");
+        p_dec->p_sys->b_abort = true;
+        goto end;
+    }
 
     if (p_dec->p_sys->b_abort)
         goto end;



More information about the vlc-commits mailing list