From 42ed4c85fc42aef87e9d78a08dfc0bdcdecb513c Mon Sep 17 00:00:00 2001 From: He Junyan Date: Thu, 29 Jul 2021 18:05:35 +0800 Subject: [PATCH] va: vp8: fix the overflow in _fill_quant_matrix(). The gint8 of qi and qi_base may overflow when calculation the matrix parameters and change the decoding result. Part-of: --- sys/va/gstvavp8dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/va/gstvavp8dec.c b/sys/va/gstvavp8dec.c index c3a6394244..997dc645b5 100644 --- a/sys/va/gstvavp8dec.c +++ b/sys/va/gstvavp8dec.c @@ -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 */