mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avoid integer overflow in dnxhd encoder, fixes #1557
Originally committed as revision 20557 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
a4fcd9966b
commit
cb893cf386
@ -574,9 +574,11 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
|
||||
last_higher = FFMAX(lambda, last_higher);
|
||||
if (last_lower != INT_MAX)
|
||||
lambda = (lambda+last_lower)>>1;
|
||||
else if ((int64_t)lambda + up_step > INT_MAX)
|
||||
return -1;
|
||||
else
|
||||
lambda += up_step;
|
||||
up_step *= 5;
|
||||
up_step = FFMIN((int64_t)up_step*5, INT_MAX);
|
||||
down_step = 1<<LAMBDA_FRAC_BITS;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user