[vlc-commits] packetizer: hevc: read overflow (cid #1346973)

Francois Cartegnie git at videolan.org
Wed Jan 25 10:56:00 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 25 10:17:42 2017 +0100| [4f42cef9e8f9c5de09413416e3cd2759b47a77e8] | committer: Francois Cartegnie

packetizer: hevc: read overflow (cid #1346973)

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

 modules/packetizer/hevc_nal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/packetizer/hevc_nal.c b/modules/packetizer/hevc_nal.c
index f5fd24e..435eb31 100644
--- a/modules/packetizer/hevc_nal.c
+++ b/modules/packetizer/hevc_nal.c
@@ -347,7 +347,7 @@ static size_t get_hvcC_to_AnnexB_NAL_size( const uint8_t *p_buf, size_t i_buf )
                 return 0;
 
             const uint16_t i_nalu_length = p_buf[0] << 8 | p_buf[1];
-            if(i_buf < i_nalu_length)
+            if(i_buf < i_nalu_length + 2)
                 return 0;
 
             i_total += i_nalu_length + i_nal_length_size;



More information about the vlc-commits mailing list