[FFmpeg-cvslog] avformat/gdv: Check fps

Michael Niedermayer git at videolan.org
Thu Mar 28 18:34:46 EET 2019


ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Tue Mar  5 00:48:18 2019 +0100| [2d825946a3970e566fa41829eb758f94169c4a0e] | committer: Michael Niedermayer

avformat/gdv: Check fps

Fixes: Division by 0
Fixes: ffmpeg_zero_division.bin

Found-by: Anatoly Trosinenko <anatoly.trosinenko at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 38381400fca45d1ae6e7604335b507b7dc70a903)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d825946a3970e566fa41829eb758f94169c4a0e
---

 libavformat/gdv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/gdv.c b/libavformat/gdv.c
index a69c349cab..3ead383892 100644
--- a/libavformat/gdv.c
+++ b/libavformat/gdv.c
@@ -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);



More information about the ffmpeg-cvslog mailing list