From 964fa0e46dab20cba7425bb7ec771a015293cba1 Mon Sep 17 00:00:00 2001 From: melanson Date: Sun, 25 Nov 2001 00:56:41 +0000 Subject: [PATCH] fixed divide-by-0 bug in FLI demuxer git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3105 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_fli.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libmpdemux/demux_fli.c b/libmpdemux/demux_fli.c index 1f6d851e78..367fbaac64 100644 --- a/libmpdemux/demux_fli.c +++ b/libmpdemux/demux_fli.c @@ -54,6 +54,7 @@ demuxer_t* demux_open_fli(demuxer_t* demuxer){ 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 @@ demuxer_t* demux_open_fli(demuxer_t* demuxer){ 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