[MPlayer-cvslog] r23205 - trunk/libmpdemux/demux_mkv.c

eugeni subversion at mplayerhq.hu
Wed May 2 01:04:21 CEST 2007


Author: eugeni
Date: Wed May  2 01:04:21 2007
New Revision: 23205

Log:
Fix NULL pointer dereference in demux_mkv that happens when
demux_mkv_get_sub_lang (or demux_mkv_get_audio_lang) is called with an invalid
track number.


Modified:
   trunk/libmpdemux/demux_mkv.c

Modified: trunk/libmpdemux/demux_mkv.c
==============================================================================
--- trunk/libmpdemux/demux_mkv.c	(original)
+++ trunk/libmpdemux/demux_mkv.c	Wed May  2 01:04:21 2007
@@ -3738,7 +3738,7 @@ demux_mkv_get_sub_lang(demuxer_t *demuxe
 {
   mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv;
   mkv_track_t *track = demux_mkv_find_track_by_num (mkv_d, track_num, MATROSKA_TRACK_SUBTITLE);
-  if (track->language && strcmp(track->language, "und"))
+  if (track && track->language && strcmp(track->language, "und"))
     strlcpy(lang, track->language, maxlen);
 }
 
@@ -3758,7 +3758,7 @@ demux_mkv_get_audio_lang(demuxer_t *demu
 {
   mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv;
   mkv_track_t *track = demux_mkv_find_track_by_num (mkv_d, track_num, MATROSKA_TRACK_AUDIO);
-  if (track->language && strcmp(track->language, "und"))
+  if (track && track->language && strcmp(track->language, "und"))
     strlcpy(lang, track->language, maxlen);
 }
 



More information about the MPlayer-cvslog mailing list