avformat/aiffdec: Check packet size

Fixes: Fixes infinite loop
Fixes: 26575/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5727522236661760

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/358/head
Michael Niedermayer 4 years ago
parent 66ca6d0fe8
commit 0ba71a72d3
  1. 2
      libavformat/aiffdec.c

@ -406,6 +406,8 @@ static int aiff_read_packet(AVFormatContext *s,
break;
default:
size = st->codecpar->block_align ? (MAX_SIZE / st->codecpar->block_align) * st->codecpar->block_align : MAX_SIZE;
if (!size)
return AVERROR_INVALIDDATA;
}
size = FFMIN(max_size, size);
res = av_get_packet(s->pb, pkt, size);

Loading…
Cancel
Save