aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-12-21 18:13:06 -0500
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 21:51:53 +0100
commita25c7081abac3a92c0fc348f449a9244d866aacd (patch)
tree666804e406b123f280162166a3b1d490ef8c1c79
parentdfdb3ca34175482887dc0480a445b880d331c6c6 (diff)
downloadffmpeg-a25c7081abac3a92c0fc348f449a9244d866aacd.tar.gz
truespeech: fix invalid reads in truespeech_apply_twopoint_filter()
fixes Bug 171 (cherry picked from commit f264d336fe61c12ce9607c3060aa5d3dca947c61) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/truespeech.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
index bb4ce6f219..9bbbf5172e 100644
--- a/libavcodec/truespeech.c
+++ b/libavcodec/truespeech.c
@@ -179,6 +179,7 @@ static void truespeech_apply_twopoint_filter(TSContext *dec, int quart)
for(i = 0; i < 146; i++)
tmp[i] = dec->filtbuf[i];
off = (t / 25) + dec->offset1[quart >> 1] + 18;
+ off = av_clip(off, 0, 145);
ptr0 = tmp + 145 - off;
ptr1 = tmp + 146;
filter = (const int16_t*)ts_order2_coeffs + (t % 25) * 2;