avcodec/texturedsp: Fix runtime error: left shift of 218 by 24 places cannot be repre...
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 9 May 2017 23:18:36 +0000 (01:18 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 9 May 2017 23:19:03 +0000 (01:19 +0200)
Fixes: 1428/clusterfuzz-testcase-minimized-5263281793007616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/texturedsp.c

index 6049c96..49e97c9 100644 (file)
@@ -291,7 +291,7 @@ static inline void dxt5_block_internal(uint8_t *dst, ptrdiff_t stride,
                     }
                 }
             }
-            pixel = colors[code & 3] | (alpha << 24);
+            pixel = colors[code & 3] | ((unsigned)alpha << 24);
             code >>= 2;
             AV_WL32(dst + x * 4, pixel);
         }