mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
avformat/shortendec: Check k in probe
Fixes: Assertion failure Fixes: 17640/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5708767475269632 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 ea770eb55941a6ed7b86828d6ea2f4e718a4b337) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
386b987f2a
commit
3ba68a5400
@ -40,12 +40,18 @@ static int shn_probe(AVProbeData *p)
|
|||||||
channels = get_ur_golomb_shorten(&gb, 0);
|
channels = get_ur_golomb_shorten(&gb, 0);
|
||||||
blocksize = 256;
|
blocksize = 256;
|
||||||
} else {
|
} else {
|
||||||
int k;
|
unsigned k;
|
||||||
k = get_ur_golomb_shorten(&gb, 2);
|
k = get_ur_golomb_shorten(&gb, 2);
|
||||||
|
if (k > 31)
|
||||||
|
return 0;
|
||||||
internal_ftype = get_ur_golomb_shorten(&gb, k);
|
internal_ftype = get_ur_golomb_shorten(&gb, k);
|
||||||
k = get_ur_golomb_shorten(&gb, 2);
|
k = get_ur_golomb_shorten(&gb, 2);
|
||||||
|
if (k > 31)
|
||||||
|
return 0;
|
||||||
channels = get_ur_golomb_shorten(&gb, k);
|
channels = get_ur_golomb_shorten(&gb, k);
|
||||||
k = get_ur_golomb_shorten(&gb, 2);
|
k = get_ur_golomb_shorten(&gb, 2);
|
||||||
|
if (k > 31)
|
||||||
|
return 0;
|
||||||
blocksize = get_ur_golomb_shorten(&gb, k);
|
blocksize = get_ur_golomb_shorten(&gb, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user