mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/snowdec: Check mv_scale
Fixes: runtime error: signed integer overflow: 2 * -1094995530 cannot be represented in type 'int' Fixes: 3512/clusterfuzz-testcase-minimized-4812747210489856 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
9c85329cd0
commit
393d6fc739
@ -394,9 +394,10 @@ static int decode_header(SnowContext *s){
|
||||
s->mv_scale += get_symbol(&s->c, s->header_state, 1);
|
||||
s->qbias += get_symbol(&s->c, s->header_state, 1);
|
||||
s->block_max_depth+= get_symbol(&s->c, s->header_state, 1);
|
||||
if(s->block_max_depth > 1 || s->block_max_depth < 0){
|
||||
if(s->block_max_depth > 1 || s->block_max_depth < 0 || s->mv_scale > 256U){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "block_max_depth= %d is too large\n", s->block_max_depth);
|
||||
s->block_max_depth= 0;
|
||||
s->mv_scale = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (FFABS(s->qbias) > 127) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user