Commit edd80ec7 authored by Mans Rullgard's avatar Mans Rullgard

aacdec: fix signed overflows in lcg_random()

Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent dd3b73f3
...@@ -787,7 +787,8 @@ static int decode_audio_specific_config(AACContext *ac, ...@@ -787,7 +787,8 @@ static int decode_audio_specific_config(AACContext *ac,
*/ */
static av_always_inline int lcg_random(int previous_val) static av_always_inline int lcg_random(int previous_val)
{ {
return previous_val * 1664525 + 1013904223; union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 };
return v.s;
} }
static av_always_inline void reset_predict_state(PredictorState *ps) static av_always_inline void reset_predict_state(PredictorState *ps)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment