mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
avcodec/bitstream: Check for integer code truncation in build_table()
Fixes: out of array read Fixes: 14563/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5646451545210880 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 e78b0f83748f92ea9e93b21c36082e0dd04d7cb1) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
837e9e8898
commit
ec23fe0fd9
@ -226,6 +226,10 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
|
||||
/* note: realloc has been done, so reload tables */
|
||||
table = (volatile VLC_TYPE (*)[2])&vlc->table[table_index];
|
||||
table[j][0] = index; //code
|
||||
if (table[j][0] != index) {
|
||||
avpriv_request_sample(NULL, "strange codes");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
i = k-1;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user