1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 05:15:12 +00:00

fixed divide-by-0 bug in FLI demuxer

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3105 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
melanson 2001-11-25 00:56:41 +00:00
parent e70be74daa
commit 964fa0e46d

View File

@ -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