diff mbox

[FFmpeg-devel] avformat/gdv: Check fps

Message ID 20190305000546.5886-1-michael@niedermayer.cc
State Accepted
Commit 38381400fca45d1ae6e7604335b507b7dc70a903
Headers show

Commit Message

Michael Niedermayer March 5, 2019, 12:05 a.m. UTC
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 | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer March 14, 2019, 1:30 p.m. UTC | #1
On Tue, Mar 05, 2019 at 01:05:46AM +0100, Michael Niedermayer wrote:
> 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 | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]
diff mbox

Patch

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);