mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-08 00:10:30 +00:00
avformat/cafdec: Check nb_entries in read_info_chunk()
Fixes: Timeout
Fixes: 477315122/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5274792315125760
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4f97e52042)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
31450268e6
commit
7306c2fa5c
1 changed files with 4 additions and 0 deletions
|
|
@ -281,6 +281,10 @@ static void read_info_chunk(AVFormatContext *s, int64_t size)
|
|||
AVIOContext *pb = s->pb;
|
||||
unsigned int i;
|
||||
unsigned int nb_entries = avio_rb32(pb);
|
||||
|
||||
if (3LL * nb_entries > size)
|
||||
return;
|
||||
|
||||
for (i = 0; i < nb_entries && !avio_feof(pb); i++) {
|
||||
char key[32];
|
||||
char value[1024];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue