Browse Source

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>
tags/n4.2
Michael Niedermayer 6 years ago
parent
commit
38381400fc
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavformat/gdv.c

+ 3
- 0
libavformat/gdv.c View File

@@ -86,6 +86,9 @@ static int gdv_read_header(AVFormatContext *ctx)
vst->nb_frames = avio_rl16(pb); vst->nb_frames = avio_rl16(pb);


fps = avio_rl16(pb); fps = avio_rl16(pb);
if (!fps)
return AVERROR_INVALIDDATA;

snd_flags = avio_rl16(pb); snd_flags = avio_rl16(pb);
if (snd_flags & 1) { if (snd_flags & 1) {
ast = avformat_new_stream(ctx, 0); ast = avformat_new_stream(ctx, 0);


Loading…
Cancel
Save