[FFmpeg-cvslog] s3tc: fix shift overflow by using unsigned constant

Mans Rullgard git at videolan.org
Sun Nov 27 00:39:13 CET 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Sat Nov 26 16:51:44 2011 +0000| [b02aa3a8eaa5673f36cfd944fe23dc3ea02b38f6] | committer: Mans Rullgard

s3tc: fix shift overflow by using unsigned constant

Signed-off-by: Mans Rullgard <mans at mansr.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b02aa3a8eaa5673f36cfd944fe23dc3ea02b38f6
---

 libavcodec/s3tc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/s3tc.c b/libavcodec/s3tc.c
index e8ca688..d0c4eb8 100644
--- a/libavcodec/s3tc.c
+++ b/libavcodec/s3tc.c
@@ -28,7 +28,7 @@
 static inline void dxt1_decode_pixels(const uint8_t *s, uint32_t *d,
                                       unsigned int qstride, unsigned int flag,
                                       uint64_t alpha) {
-    unsigned int x, y, c0, c1, a = (!flag * 255) << 24;
+    unsigned int x, y, c0, c1, a = (!flag * 255u) << 24;
     unsigned int rb0, rb1, rb2, rb3, g0, g1, g2, g3;
     uint32_t colors[4], pixels;
 



More information about the ffmpeg-cvslog mailing list