Skip to content

Commit

Permalink
avformat/wtvdec: Check length of read mpeg2_descriptor
Browse files Browse the repository at this point in the history
Fixes: Use of uninitialized value
Fixes: 70900/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6286909377150976

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>
  • Loading branch information
michaelni committed Aug 8, 2024
1 parent c95ea03 commit c390234
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libavformat/wtvdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,8 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
}

buf_size = FFMIN(len - consumed, sizeof(buf));
avio_read(pb, buf, buf_size);
if (avio_read(pb, buf, buf_size) != buf_size)
return AVERROR_INVALIDDATA;
consumed += buf_size;
ff_parse_mpeg2_descriptor(s, st, 0, &pbuf, buf + buf_size, NULL, 0, 0, NULL);
}
Expand Down

0 comments on commit c390234

Please sign in to comment.