[vlc-commits] avi: Fix potential leak

Hugo Beauzée-Luyssen git at videolan.org
Fri Jun 12 10:15:48 CEST 2020


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Jun 11 16:14:58 2020 +0200| [3a6f920650ecf22331a9132dada069227b3f5055] | committer: Hugo Beauzée-Luyssen

avi: Fix potential leak

When AVI_IndexLoad gets invoked multiple time on the same file, we end
up overwriting the previous index table.

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

 modules/demux/avi/avi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 38c8cb61db..34bd228681 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -2549,12 +2549,14 @@ static void AVI_IndexLoad( demux_t *p_demux )
         if( p_idx_indx[i].i_size > p_idx_idx1[i].i_size )
         {
             msg_Dbg( p_demux, "selected ODML index for stream[%u]", i );
+            free(p_sys->track[i]->idx.p_entry);
             p_sys->track[i]->idx = p_idx_indx[i];
             avi_index_Clean( &p_idx_idx1[i] );
         }
         else
         {
             msg_Dbg( p_demux, "selected standard index for stream[%u]", i );
+            free(p_sys->track[i]->idx.p_entry);
             p_sys->track[i]->idx = p_idx_idx1[i];
             avi_index_Clean( &p_idx_indx[i] );
         }



More information about the vlc-commits mailing list