]> git.sesse.net Git - ffmpeg/commitdiff
vp9: fix integer overflow in 10/12bpp DC-only calculation.
authorRonald S. Bultje <rsbultje@gmail.com>
Fri, 4 Sep 2015 20:57:07 +0000 (16:57 -0400)
committerRonald S. Bultje <rsbultje@gmail.com>
Sat, 5 Sep 2015 19:50:01 +0000 (15:50 -0400)
libavcodec/vp9dsp_template.c

index 5a8578a8988d8f939e0db1598c51b63a16ab460f..9395a0c202bda34d17e8c538ff5b9d9a7b76aeb3 100644 (file)
@@ -1131,8 +1131,8 @@ static void type_a##_##type_b##_##sz##x##sz##_add_c(uint8_t *_dst, \
 \
     stride /= sizeof(pixel); \
     if (has_dconly && eob == 1) { \
-        const int t  = (((block[0] * 11585 + (1 << 13)) >> 14) \
-                                   * 11585 + (1 << 13)) >> 14; \
+        const int t  = ((((dctint) block[0] * 11585 + (1 << 13)) >> 14) \
+                                            * 11585 + (1 << 13)) >> 14; \
         block[0] = 0; \
         for (i = 0; i < sz; i++) { \
             for (j = 0; j < sz; j++) \