changeset 12721:44895a7161c8

Do not dereference NULL if no track could be found for a block.
author mosu
date Mon, 28 Jun 2004 16:43:01 +0000
parents 0eddf78981ed
children 5ce932ea93aa
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Mon Jun 28 16:36:50 2004 +0000
+++ b/libmpdemux/demux_mkv.c	Mon Jun 28 16:43:01 2004 +0000
@@ -2704,8 +2704,15 @@
   clear_subtitles(demuxer, tc, 0);
 
   for (i=0; i<mkv_d->num_tracks; i++)
-    if (mkv_d->tracks[i]->tnum == num)
+    if (mkv_d->tracks[i]->tnum == num) {
       track = mkv_d->tracks[i];
+      break;
+    }
+  if (track == NULL)
+    {
+      free(lace_size);
+      return 1;
+    }
   if (num == demuxer->audio->id)
     {
       ds = demuxer->audio;