avformat/wtvdec: Check for EOF before seeking back in parse_media_type()

Fixes: Infinite loop
Fixes: 36311/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-4889181296918528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/364/head
Michael Niedermayer 3 years ago
parent 2bbef69b0b
commit 89505d38de
  1. 2
      libavformat/wtvdec.c

@ -652,6 +652,8 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
avio_skip(pb, size - 32);
ff_get_guid(pb, &actual_subtype);
ff_get_guid(pb, &actual_formattype);
if (avio_feof(pb))
return NULL;
avio_seek(pb, -size, SEEK_CUR);
st = parse_media_type(s, st, sid, mediatype, actual_subtype, actual_formattype, size - 32);

Loading…
Cancel
Save