mirror of https://git.ffmpeg.org/ffmpeg.git
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>
(cherry picked from commit 0ba71a72d3
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
fa31c57838
commit
c1574b35c3
|
@ -398,6 +398,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…
Reference in New Issue