aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-11-24 13:12:47 +0000
committerMans Rullgard <mans@mansr.com>2012-11-26 13:34:58 +0000
commitedd80ec7e32b097043432fa67281ed8c6d044331 (patch)
tree74363f51838429ea8f94b54403b8448997882073
parentdd3b73f3905c61c99f1d3fb58bc7ee380eb8aa2e (diff)
downloadffmpeg-edd80ec7e32b097043432fa67281ed8c6d044331.tar.gz
aacdec: fix signed overflows in lcg_random()
Signed-off-by: Mans Rullgard <mans@mansr.com>
-rw-r--r--libavcodec/aacdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index d2a31cae0b..af17acfb75 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -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)