[vlc-commits] h264_nal: add missing sanity check

Felix Paul Kühne git at videolan.org
Wed Jul 8 20:57:54 CEST 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Jul  8 20:57:40 2015 +0200| [6631504270d57d7dc16f6fc49d0985bbc5b02971] | committer: Felix Paul Kühne

h264_nal: add missing sanity check

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

 modules/packetizer/h264_nal.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/packetizer/h264_nal.c b/modules/packetizer/h264_nal.c
index a2dd888..a35f861 100644
--- a/modules/packetizer/h264_nal.c
+++ b/modules/packetizer/h264_nal.c
@@ -148,6 +148,9 @@ int h264_get_spspps( uint8_t *p_buf, size_t i_buf,
     size_t i_sps_size = 0, i_pps_size = 0;
     int i_nal_type = NAL_UNKNOWN;
 
+    if (unlikely(p_buf == NULL || i_buf == 0))
+        return -1;
+
     while( true )
     {
         int i_inc = 0;



More information about the vlc-commits mailing list