summaryrefslogtreecommitdiff
path: root/libavcodec/binkidct.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2011-02-13 14:37:20 +1100
committerRonald S. Bultje <rsbultje@gmail.com>2011-02-25 15:24:35 -0500
commite211e255aa399d68239ffa42c9cc7a52eb3d55a9 (patch)
treebaf0816028053992a369ad181aa8e04f336b01a4 /libavcodec/binkidct.c
parent588a3ffd9687cbef60cc26d5b3a247b8ecdbf75b (diff)
downloadffmpeg-e211e255aa399d68239ffa42c9cc7a52eb3d55a9.tar.gz
bink: prevent overflows within binkidct by using int-sized intermediate array
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/binkidct.c')
-rw-r--r--libavcodec/binkidct.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/binkidct.c b/libavcodec/binkidct.c
index 160926e163..ddb6cc1af3 100644
--- a/libavcodec/binkidct.c
+++ b/libavcodec/binkidct.c
@@ -62,7 +62,7 @@
#define MUNGE_ROW(x) (((x) + 0x7F)>>8)
#define IDCT_ROW(dest,src) IDCT_TRANSFORM(dest,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,MUNGE_ROW,src)
-static inline void bink_idct_col(DCTELEM *dest, const DCTELEM *src)
+static inline void bink_idct_col(int *dest, const DCTELEM *src)
{
if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) {
dest[0] =
@@ -81,7 +81,7 @@ static inline void bink_idct_col(DCTELEM *dest, const DCTELEM *src)
void ff_bink_idct_c(DCTELEM *block)
{
int i;
- DCTELEM temp[64];
+ int temp[64];
for (i = 0; i < 8; i++)
bink_idct_col(&temp[i], &block[i]);
@@ -103,7 +103,7 @@ void ff_bink_idct_add_c(uint8_t *dest, int linesize, DCTELEM *block)
void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block)
{
int i;
- DCTELEM temp[64];
+ int temp[64];
for (i = 0; i < 8; i++)
bink_idct_col(&temp[i], &block[i]);
for (i = 0; i < 8; i++) {