avformat/gdv: Check fps
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 4 Mar 2019 23:48:18 +0000 (00:48 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 14 Mar 2019 15:24:35 +0000 (16:24 +0100)
Fixes: Division by 0
Fixes: ffmpeg_zero_division.bin

Found-by: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/gdv.c

index a69c349..3ead383 100644 (file)
@@ -86,6 +86,9 @@ static int gdv_read_header(AVFormatContext *ctx)
     vst->nb_frames         = avio_rl16(pb);
 
     fps = avio_rl16(pb);
+    if (!fps)
+        return AVERROR_INVALIDDATA;
+
     snd_flags = avio_rl16(pb);
     if (snd_flags & 1) {
         ast = avformat_new_stream(ctx, 0);