changeset 3104:829637d529e9

fixed divide-by-0 bug in FLI demuxer
author melanson
date Sun, 25 Nov 2001 00:56:41 +0000
parents 3867ec4a02d2
children f951f3be126c
files libmpdemux/demux_fli.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_fli.c	Sun Nov 25 00:40:26 2001 +0000
+++ b/libmpdemux/demux_fli.c	Sun Nov 25 00:56:41 2001 +0000
@@ -54,6 +54,7 @@
   sh_video_t *sh_video = NULL;
   fli_frames_t *frames = (fli_frames_t *)malloc(sizeof(fli_frames_t));
   int frame_number;
+  int speed;
 
   // go back to the beginning
   stream_reset(demuxer->stream);
@@ -94,7 +95,10 @@
   stream_skip(demuxer->stream, 4);
 
   // get the speed
-  sh_video->fps = 1000 / stream_read_word_le(demuxer->stream);
+  speed = stream_read_word_le(demuxer->stream);
+  if (speed == 0)
+    speed = 1;
+  sh_video->fps = 1000 / speed;
   sh_video->frametime = 1/sh_video->fps;
 
   // build the frame index