From 288dc5b4a11884b9a5cd62310abe99878544982b Mon Sep 17 00:00:00 2001 From: Tom Butterworth Date: Thu, 7 May 2015 21:21:46 +0100 Subject: [PATCH] avcodec/s3tc: fix alpha decoding when dimensions are not a multiple of 4 Fix alpha position error for edge blocks of odd-dimensioned frames Signed-off-by: Michael Niedermayer --- libavcodec/s3tc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/s3tc.c b/libavcodec/s3tc.c index 9886b1dc9c..a422874d17 100644 --- a/libavcodec/s3tc.c +++ b/libavcodec/s3tc.c @@ -71,8 +71,10 @@ static inline void dxt1_decode_pixels(GetByteContext *gb, uint32_t *d, pixels >>= 2; alpha >>= 4; } - for (; x<4; x++) + for (; x<4; x++) { pixels >>= 2; + alpha >>= 4; + } d += qstride; } }