[libav-commits] v410enc: fix undefined signed left shift caused by integer promotion

Janne Grunau git at libav.org
Mon Jan 2 19:27:54 CET 2012


Module: libav
Branch: master
Commit: 264808219d8be93aeda0b6ade8c64898b673f6bc

Author:    Janne Grunau <janne-libav at jannau.net>
Committer: Janne Grunau <janne-libav at jannau.net>
Date:      Mon Jan  2 15:47:26 2012 +0100

v410enc: fix undefined signed left shift caused by integer promotion

---

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

diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c
index 95b36c1..11c6abc 100644
--- a/libavcodec/v410enc.c
+++ b/libavcodec/v410enc.c
@@ -67,7 +67,7 @@ static int v410_encode_frame(AVCodecContext *avctx, uint8_t *buf,
         for (j = 0; j < avctx->width; j++) {
             val  = u[j] << 2;
             val |= y[j] << 12;
-            val |= v[j] << 22;
+            val |= (uint32_t) v[j] << 22;
             AV_WL32(dst, val);
             dst += 4;
             output_size += 4;



More information about the libav-commits mailing list