1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

avformat/iff: Check that we have a stream in read_dst_frame()

Fixes: null pointer dereference
Fixes: 385644864/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-4551049565765632

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>
This commit is contained in:
Michael Niedermayer
2025-02-09 01:28:17 +01:00
parent 464fb861b1
commit 8668957ef6

View File

@@ -364,6 +364,9 @@ static int read_dst_frame(AVFormatContext *s, AVPacket *pkt)
uint64_t chunk_pos, data_pos, data_size;
int ret = AVERROR_EOF;
if (s->nb_streams < 1)
return AVERROR_INVALIDDATA;
while (!avio_feof(pb)) {
chunk_pos = avio_tell(pb);
if (chunk_pos >= iff->body_end)