[vlc-commits] demux/xiph_metadata: prevent null-pointer dereference
Filip Roséen
git at videolan.org
Mon Dec 5 14:07:21 CET 2016
vlc/vlc-2.2 | branch: master | Filip Roséen <filip at atch.se> | Mon Dec 5 13:52:54 2016 +0100| [9fe413ea1cc1caef546b8413c4eb077cad34dab2] | committer: Jean-Baptiste Kempf
demux/xiph_metadata: prevent null-pointer dereference
modules/demux/flac.c invokes vorbis_ParseComment with NULL as argument
for both i_seekpoint and ppp_seekpoint since the demuxer lacks support
for these entities.
These changes simply make sure that we do not treat the two parameters
as valid, if they are actually NULL.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=9fe413ea1cc1caef546b8413c4eb077cad34dab2
---
modules/demux/xiph_metadata.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/modules/demux/xiph_metadata.c b/modules/demux/xiph_metadata.c
index f68d5e0..de7f289 100644
--- a/modules/demux/xiph_metadata.c
+++ b/modules/demux/xiph_metadata.c
@@ -430,12 +430,16 @@ void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
}
#undef RM
- for ( unsigned int i=0; i<chapters_array.i_size; i++ )
+ if( i_seekpoint && ppp_seekpoint )
{
- if ( !chapters_array.pp_chapters[i] ) continue;
- TAB_APPEND_CAST( (seekpoint_t**), *i_seekpoint, *ppp_seekpoint,
- chapters_array.pp_chapters[i] );
+ for ( unsigned int i=0; i<chapters_array.i_size; i++ )
+ {
+ if ( !chapters_array.pp_chapters[i] ) continue;
+ TAB_APPEND_CAST( (seekpoint_t**), *i_seekpoint, *ppp_seekpoint,
+ chapters_array.pp_chapters[i] );
+ }
}
+
free( chapters_array.pp_chapters );
}
More information about the vlc-commits
mailing list