Browse code

avformat/gdv: Check fps

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>
(cherry picked from commit 38381400fca45d1ae6e7604335b507b7dc70a903)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Michael Niedermayer authored on 2019/03/05 08:48:18
Showing 1 changed files
... ...
@@ -86,6 +86,9 @@ static int gdv_read_header(AVFormatContext *ctx)
86 86
     vst->nb_frames         = avio_rl16(pb);
87 87
 
88 88
     fps = avio_rl16(pb);
89
+    if (!fps)
90
+        return AVERROR_INVALIDDATA;
91
+
89 92
     snd_flags = avio_rl16(pb);
90 93
     if (snd_flags & 1) {
91 94
         ast = avformat_new_stream(ctx, 0);