va: h265dec: Fix a temp var overflow bug when write pred weight table.

The temp guint8 var of delta_chroma_offset_l0 and delta_chroma_offset_l1
can not cover the full range of delta_chroma_weight_l0/1 in the slice
header. When overflow happens, the decoder result is wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2412>
This commit is contained in:
He Junyan 2021-07-15 21:32:54 +08:00 committed by GStreamer Marge Bot
parent bc09d8cc66
commit 67d482f8fb

View file

@ -381,7 +381,7 @@ _fill_pred_weight_table (GstVaH265Dec * self, GstH265SliceHdr * header,
continue;
for (j = 0; j < 2; j++) {
gint8 delta_chroma_offset_l0 =
gint16 delta_chroma_offset_l0 =
header->pred_weight_table.delta_chroma_offset_l0[i][j];
gint chroma_offset;
@ -430,7 +430,7 @@ _fill_pred_weight_table (GstVaH265Dec * self, GstH265SliceHdr * header,
continue;
for (j = 0; j < 2; j++) {
gint8 delta_chroma_offset_l1 =
gint16 delta_chroma_offset_l1 =
header->pred_weight_table.delta_chroma_offset_l1[i][j];
gint chroma_offset;