[FFmpeg-cvslog] avcodec/gdv: Fix undefined shift

Michael Niedermayer git at videolan.org
Sat Jun 17 03:14:37 EEST 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Jun 16 23:31:42 2017 +0200| [9b65dbf7349aace16f7ca65f7cef1a368e2d83d9] | committer: Michael Niedermayer

avcodec/gdv: Fix undefined shift

Fixes: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 2249/clusterfuzz-testcase-minimized-5388542379294720

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/gdv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c
index cae82b825d..275af9a351 100644
--- a/libavcodec/gdv.c
+++ b/libavcodec/gdv.c
@@ -330,7 +330,7 @@ static int gdv_decode_frame(AVCodecContext *avctx, void *data,
             unsigned r = bytestream2_get_byte(gb);
             unsigned g = bytestream2_get_byte(gb);
             unsigned b = bytestream2_get_byte(gb);
-            gdv->pal[i] = 0xFF << 24 | r << 18 | g << 10 | b << 2;
+            gdv->pal[i] = 0xFFU << 24 | r << 18 | g << 10 | b << 2;
         }
         break;
     case 3:



More information about the ffmpeg-cvslog mailing list