avcodec/mmvideo: Fix undefined behavior (left shift of negative value)
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 8 Oct 2014 02:12:26 +0000 (04:12 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 8 Oct 2014 03:35:01 +0000 (05:35 +0200)
Fixes: asan_heap-oob_4da4f3_8_asan_heap-oob_4da4f3_419_scene1a.mm

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mmvideo.c

index 9ff6393..9a7c10c 100644 (file)
@@ -49,7 +49,7 @@
 typedef struct MmContext {
     AVCodecContext *avctx;
     AVFrame *frame;
-    int palette[AVPALETTE_COUNT];
+    unsigned int palette[AVPALETTE_COUNT];
     GetByteContext gb;
 } MmContext;