From 55c7e4ad5d5e83e1f43d70d0224aa94d62a1b4f8 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 19 Dec 2004 02:55:40 +0000 Subject: [PATCH] broken avi / div by zero fix Originally committed as revision 3761 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/avidec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 72989fcc80..fa33101106 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -252,6 +252,8 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) get_le32(pb); /* initial frame */ ast->scale = get_le32(pb); /* scale */ ast->rate = get_le32(pb); + if(!ast->rate) + ast->rate= 1; //wrong but better then 1/0 av_set_pts_info(st, 64, ast->scale, ast->rate); ast->start= get_le32(pb); /* start */ length = get_le32(pb); /* length, in samples or bytes */