[vlc-commits] packetizer/h264: fix resource deallocation during Close

Filip Roséen git at videolan.org
Wed Feb 8 14:38:50 CET 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Tue Feb  7 02:35:46 2017 +0100| [8cc427c799140d71c761d1b29727dd2cf73e62ed] | committer: Jean-Baptiste Kempf

packetizer/h264: fix resource deallocation during Close

The previous loop condition suffers from an off-by-one error, meaning
that the last resource in p_sys->pp_sps and p_sys->pp_pps would never
be released if populated.

fixes #17987

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/packetizer/h264.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 1b455af..4d2db65 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -330,12 +330,12 @@ static void Close( vlc_object_t *p_this )
 
     if( p_sys->p_frame )
         block_ChainRelease( p_sys->p_frame );
-    for( i = 0; i < H264_SPS_ID_MAX; i++ )
+    for( i = 0; i <= H264_SPS_ID_MAX; i++ )
     {
         if( p_sys->pp_sps[i] )
             block_Release( p_sys->pp_sps[i] );
     }
-    for( i = 0; i < H264_PPS_ID_MAX; i++ )
+    for( i = 0; i <= H264_PPS_ID_MAX; i++ )
     {
         if( p_sys->pp_pps[i] )
             block_Release( p_sys->pp_pps[i] );



More information about the vlc-commits mailing list