[vlc-commits] [Git][videolan/vlc][3.0.x] 2 commits: demux: avi: add AVI_ChunkInit
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Thu Mar 26 15:07:42 UTC 2026
Felix Paul Kühne pushed to branch 3.0.x at VideoLAN / VLC
Commits:
24492ef2 by François Cartegnie at 2026-03-26T14:21:31+01:00
demux: avi: add AVI_ChunkInit
(cherry picked from commit 6fb88161c3eeb2a5c9447eca3d85fdc4cb1d0c4b)
- - - - -
52660d47 by François Cartegnie at 2026-03-26T14:21:31+01:00
demux: avi: fix potential leak reparsing for index
refs #29225
(cherry picked from commit 08e0999642c6435ce39a94d56969e3b4814801ee)
- - - - -
3 changed files:
- modules/demux/avi/avi.c
- modules/demux/avi/libavi.c
- modules/demux/avi/libavi.h
Changes:
=====================================
modules/demux/avi/avi.c
=====================================
@@ -3100,6 +3100,7 @@ static void AVI_ExtractSubtitle( demux_t *p_demux,
p_indx = AVI_ChunkFind( p_strl, AVIFOURCC_indx, 0, false );
avi_chunk_t ck;
+ AVI_ChunkInit( &ck );
int64_t i_position;
unsigned i_size;
if( p_indx )
@@ -3111,6 +3112,7 @@ static void AVI_ExtractSubtitle( demux_t *p_demux,
AVI_ChunkRead( p_demux->s, &ck, NULL ) ||
ck.common.i_chunk_fourcc != AVIFOURCC_indx )
goto exit;
+
p_indx = &ck.indx;
}
@@ -3213,8 +3215,7 @@ exit:
else
msg_Warn( p_demux, "Failed to load an embedded subtitle" );
- if( p_indx == &ck.indx )
- AVI_ChunkClean( p_demux->s, &ck );
+ AVI_ChunkClean( p_demux->s, &ck );
}
/*****************************************************************************
* Stream management
=====================================
modules/demux/avi/libavi.c
=====================================
@@ -64,7 +64,7 @@ static int AVI_ChunkReadCommon( stream_t *s, avi_chunk_t *p_chk,
{
const uint8_t *p_peek;
- memset( p_chk, 0, sizeof( avi_chunk_t ) );
+ AVI_ChunkInit( p_chk );
const uint64_t i_pos = vlc_stream_Tell( s );
if( vlc_stream_Peek( s, &p_peek, 8 ) < 8 )
@@ -1051,11 +1051,16 @@ void AVI_ChunkClean( stream_t *s,
msg_Warn( (vlc_object_t*)s, "unknown chunk: %4.4s (not unloaded)",
(char*)&p_chk->common.i_chunk_fourcc );
}
- p_chk->common.p_first = NULL;
+ AVI_ChunkInit( p_chk );
return;
}
+void AVI_ChunkInit( avi_chunk_t *p_chk )
+{
+ memset( p_chk, 0, sizeof(*p_chk) );
+}
+
static void AVI_ChunkDumpDebug_level( vlc_object_t *p_obj,
avi_chunk_t *p_chk, unsigned i_level )
{
=====================================
modules/demux/avi/libavi.h
=====================================
@@ -252,6 +252,7 @@ int AVI_ChunkRead( stream_t *,
avi_chunk_t *p_chk,
avi_chunk_t *p_father );
void AVI_ChunkClean( stream_t *, avi_chunk_t * );
+void AVI_ChunkInit( avi_chunk_t * );
int AVI_ChunkCount_( avi_chunk_t *, vlc_fourcc_t, bool );
void *AVI_ChunkFind_ ( avi_chunk_t *, vlc_fourcc_t, int, bool );
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9f6a5858764668c4b9d73872989c7dd299b6d59e...52660d4727f140725ef5dc3d732b1ce895be8ff9
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9f6a5858764668c4b9d73872989c7dd299b6d59e...52660d4727f140725ef5dc3d732b1ce895be8ff9
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list