OSDN Git Service

avcodec/flacdsp_template: Fix undefined shift in flac_decorrelate_indep_c
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 3 Dec 2016 15:43:10 +0000 (16:43 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 3 Dec 2016 16:25:40 +0000 (17:25 +0100)
Fixes: left shift of negative value
Fixes: 668346-media

Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/flacdsp_template.c

index 62c0a15..776c78d 100644 (file)
@@ -56,7 +56,7 @@ static void FUNC(flac_decorrelate_indep_c)(uint8_t **out, int32_t **in,
 
     for (j = 0; j < len; j++)
         for (i = 0; i < channels; i++)
-            S(samples, i, j) = in[i][j] << shift;
+            S(samples, i, j) = (int)((unsigned)in[i][j] << shift);
 }
 
 static void FUNC(flac_decorrelate_ls_c)(uint8_t **out, int32_t **in,