avcodec/flacdec: Fix signed integer overflow in decode_subframe_fixed()
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 3 Dec 2016 16:05:43 +0000 (17:05 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 5 Dec 2016 23:07:50 +0000 (00:07 +0100)
Fixes undefined behavior
Fixes: 640912-media

Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 83a75bf6c31b3c0ce2ca7e1426d1f2e3df634239)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/flacdec.c

index b7237e1..5f5802c 100644 (file)
@@ -268,7 +268,8 @@ static int decode_subframe_fixed(FLACContext *s, int32_t *decoded,
                                  int pred_order, int bps)
 {
     const int blocksize = s->blocksize;
-    int av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d), i;
+    unsigned av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d);
+    int i;
     int ret;
 
     /* warm up samples */