changeset 35313:2b211b058ee2

Avoid crash when parsing index for audio-only files.
author reimar
date Sat, 10 Nov 2012 14:31:14 +0000
parents 3e6a575bd47b
children eaace9a7e822
files libmpdemux/demux_film.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_film.c	Sat Nov 10 14:27:09 2012 +0000
+++ b/libmpdemux/demux_film.c	Sat Nov 10 14:31:14 2012 +0000
@@ -410,7 +410,7 @@
         if (counting_chunks)
         {
           // if we're counting chunks, always count an audio chunk
-          if (film_chunk.syncinfo1 == 0xFFFFFFFF)
+          if (!sh_video || film_chunk.syncinfo1 == 0xFFFFFFFF)
             film_data->chunks_per_second++;
           // if it's a video chunk, check if it's time to stop counting
           else if ((film_chunk.syncinfo1 & 0x7FFFFFFF) >= sh_video->fps)
@@ -420,7 +420,7 @@
         }
 
         // precalculate PTS
-        if (film_chunk.syncinfo1 == 0xFFFFFFFF)
+        if (!sh_video || film_chunk.syncinfo1 == 0xFFFFFFFF)
         {
 	  if(demuxer->audio->id>=-1)
           film_chunk.pts =