h265bitwriter: Don't use type too small

The computed `coef_val` could exceed the maximum range of a gint8. Use a bigger
one, the checks after will ensure it's properly cropped/padded

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8286>
This commit is contained in:
Edward Hervey 2025-01-06 09:57:33 +01:00 committed by GStreamer Marge Bot
parent 5bb22c24dc
commit 916774b4f0

View file

@ -639,7 +639,6 @@ _h265_bit_writer_scaling_lists (const GstH265ScalingList * src_scaling_list,
const guint8 *sl;
const guint8 *default_sl;
guint8 nextCoef;
gint8 coef_val;
guint8 scaling_list_pred_matrix_id_delta;
if (!_get_scaling_list_params (src_scaling_list, sizeId, matrixId,
@ -696,7 +695,7 @@ _h265_bit_writer_scaling_lists (const GstH265ScalingList * src_scaling_list,
}
for (i = 0; i < size; i++) {
coef_val = sl[i] - nextCoef;
gint coef_val = sl[i] - nextCoef;
nextCoef = sl[i];
if (coef_val > 127) {