[FFmpeg-devel] [PATCH] avcodec/s3tc: fix alpha decoding when dimensions are not a multiple of 4

Tom Butterworth bangnoise at gmail.com
Thu May 7 22:21:46 CEST 2015


Fix alpha position error for edge blocks of odd-dimensioned frames
---
 libavcodec/s3tc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/s3tc.c b/libavcodec/s3tc.c
index 9886b1d..a422874 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;
     }
 }
-- 
2.3.2 (Apple Git-55)



More information about the ffmpeg-devel mailing list