Skip to content

Commit

Permalink
aacdec: fix signed overflows in lcg_random()
Browse files Browse the repository at this point in the history
Signed-off-by: Mans Rullgard <[email protected]>
  • Loading branch information
mansr committed Nov 26, 2012
1 parent dd3b73f commit edd80ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libavcodec/aacdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,8 @@ static int decode_audio_specific_config(AACContext *ac,
*/
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)
Expand Down

0 comments on commit edd80ec

Please sign in to comment.