va: vp8: fix the overflow in _fill_quant_matrix().
authorHe Junyan <junyan.he@intel.com>
Thu, 29 Jul 2021 10:05:35 +0000 (18:05 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 29 Jul 2021 20:28:20 +0000 (20:28 +0000)
The gint8 of qi and qi_base may overflow when calculation the matrix
parameters and change the decoding result.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2447>

sys/va/gstvavp8dec.c

index c3a6394..997dc64 100644 (file)
@@ -227,7 +227,7 @@ _fill_quant_matrix (GstVp8Decoder * decoder, GstVp8Picture * picture,
   GstVp8Segmentation *const seg = &parser->segmentation;
   VAIQMatrixBufferVP8 iq_matrix = { };
   const gint8 QI_MAX = 127;
-  gint8 qi, qi_base;
+  gint16 qi, qi_base;
   gint i;
 
   /* Fill in VAIQMatrixBufferVP8 */