[vlc-devel] [PATCH] avi: Fix potential leak
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Thu Jun 11 16:16:38 CEST 2020
When AVI_IndexLoad gets invoked multiple time on the same file, we end
up overwriting the previous index table.
---
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] );
}
--
2.20.1
More information about the vlc-devel
mailing list