[FFmpeg-devel] [PATCH 2/2] avcodec/pictordec: runtime error: left shift of 15 by 28 places cannot be represented in type 'int'

Michael Niedermayer michael at niedermayer.cc
Tue Mar 21 03:52:02 EET 2017


Fixes: 898/clusterfuzz-testcase-6149765467209728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/pictordec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c
index 8b075bfd0c..b29a484534 100644
--- a/libavcodec/pictordec.c
+++ b/libavcodec/pictordec.c
@@ -62,7 +62,7 @@ static void picmemset(PicContext *s, AVFrame *frame, unsigned value, int run,
 {
     uint8_t *d;
     int shift = *plane * bits_per_plane;
-    unsigned mask  = ((1 << bits_per_plane) - 1) << shift;
+    unsigned mask  = ((1U << bits_per_plane) - 1) << shift;
     value   <<= shift;
 
     while (run > 0) {
-- 
2.11.0



More information about the ffmpeg-devel mailing list