mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/shorten: Check verbatim length
Fixes: Timeout Fixes: 9252/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5780720709533696 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 7007dabec08f2f9f81661e71ef482dde394e17a8) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0ea1b62b9a
commit
488c246bf5
@ -623,6 +623,11 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case FN_VERBATIM:
|
case FN_VERBATIM:
|
||||||
len = get_ur_golomb_shorten(&s->gb, VERBATIM_CKSIZE_SIZE);
|
len = get_ur_golomb_shorten(&s->gb, VERBATIM_CKSIZE_SIZE);
|
||||||
|
if (len < 0 || len > get_bits_left(&s->gb)) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "verbatim length %d invalid\n",
|
||||||
|
len);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
while (len--)
|
while (len--)
|
||||||
get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
|
get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user