[vlc-commits] packetizer: hevc: fix small vcl regression

Francois Cartegnie git at videolan.org
Thu Dec 24 01:45:17 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 24 01:12:58 2015 +0100| [482005d068b43ca9c8c22dd4490736a7823c4efc] | committer: Francois Cartegnie

packetizer: hevc: fix small vcl regression

Wrong 7 bytes test + 4 bytes prefix > 8 bytes nal
WPP_A_ericsson_MAIN10_2.bit

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

 modules/packetizer/hevc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index e4078ef..422a4e6 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -300,8 +300,11 @@ static block_t *ParseVCL(decoder_t *p_dec, uint8_t i_nal_type, block_t *p_frag)
     const uint8_t *p_buffer = p_frag->p_buffer;
     size_t i_buffer = p_frag->i_buffer;
 
-    if(unlikely(!hxxx_strip_AnnexB_startcode(&p_buffer, &i_buffer) || i_buffer < 7))
+    if(unlikely(!hxxx_strip_AnnexB_startcode(&p_buffer, &i_buffer) || i_buffer < 3))
+    {
+        block_ChainAppend(&p_sys->p_frame, p_frag); /* might corrupt */
         return NULL;
+    }
 
     bool b_first_slice_in_pic = p_buffer[2] & 0x80;
     if (b_first_slice_in_pic)



More information about the vlc-commits mailing list