François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
f12988ae by François Cartegnie at 2026-03-06T06:30:27+01:00
packetizer: hxxx: fix invalid deref

refs #29610

regression by 36e3056262eb8ee5ab11be4cb54020e78d416d26

- - - - -


2 changed files:

- modules/packetizer/h264_nal.c
- modules/packetizer/hevc_nal.c


Changes:

=====================================
modules/packetizer/h264_nal.c
=====================================
@@ -154,10 +154,11 @@ bool h264_avcC_to_AnnexB_NAL( const uint8_t *p_buf, 
size_t i_buf,
     /* Read infos in first 6 bytes */
     const uint8_t i_nal_length_size = (p_buf[4] & 0x03) + 1;
 
+    uint8_t *p_ret = NULL;
     uint8_t *p_out_buf = NULL;
     if( i_result > 0 )
     {
-        p_out_buf = malloc( i_result );
+        p_ret = p_out_buf = malloc( i_result );
         if( !p_out_buf )
             return false;
 
@@ -183,7 +184,7 @@ bool h264_avcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t 
i_buf,
         }
     }
 
-    *pp_result = p_out_buf;
+    *pp_result = p_ret;
     *pi_result = i_result;
 
     if ( pi_nal_length_size )


=====================================
modules/packetizer/hevc_nal.c
=====================================
@@ -354,9 +354,10 @@ bool hevc_hvcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t 
i_buf,
 
     const uint8_t i_nal_length_size = hevc_getNALLengthSize( p_buf );
     uint8_t *p_out_buf = NULL;
+    uint8_t *p_ret = NULL;
     if( i_result > 0 )
     {
-        p_out_buf = malloc( i_result );
+        p_ret = p_out_buf = malloc( i_result );
         if( !p_out_buf )
             return false;
 
@@ -381,7 +382,7 @@ bool hevc_hvcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t 
i_buf,
         }
     }
 
-    *pp_result = p_out_buf;
+    *pp_result = p_ret;
     *pi_result = i_result;
     if( pi_nal_length_size )
         *pi_nal_length_size = i_nal_length_size;



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/f12988ae40f57dee5e1c902b41a746b2b5dda64b

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/f12988ae40f57dee5e1c902b41a746b2b5dda64b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to