[FFmpeg-devel] avidec.c

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Dec 8 23:56:50 CET 2014


On Monday 08 December 2014 08:28:00 pm Michael Niedermayer wrote:
> On Mon, Dec 08, 2014 at 03:42:25PM +0100, Gabor Nagy wrote:
> > Hello!
> >
> > Let me suggest two small changes in avidec.c
> > first is at 129. line and second at  663. line.
>
> please "git commit" your changes, write a proper commit message
> and generate a git patch with "git format-patch -1" and then
> post that patch here
>
> as is this is not reviewable

At least as important:
Please explain what these changes fix / how we can reproduce 
the issues you see.

Thank you, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 78a6dea..a8318ff 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -126,7 +126,7 @@ static inline int get_duration(AVIStream *ast, int len)
 {
     if (ast->sample_size)
         return len;
-    else if (ast->dshow_block_align)
+    else if (ast->dshow_block_align > 1)
         return (len + ast->dshow_block_align - 1) / ast->dshow_block_align;
     else
         return 1;
@@ -659,7 +659,7 @@ static int avi_read_header(AVFormatContext *s)
             avio_rl32(pb); /* quality */
             if (ast->cum_len*ast->scale/ast->rate > 3600) {
                 av_log(s, AV_LOG_ERROR, "crazy start time, iam scared, giving up\n");
-                return AVERROR_INVALIDDATA;
+                ast->cum_len = 0;
             }
             ast->sample_size = avio_rl32(pb); /* sample ssize */
             ast->cum_len    *= FFMAX(1, ast->sample_size);


More information about the ffmpeg-devel mailing list