From c9deee751787aaca465daaea252504ec1f500beb Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Sun, 2 May 2021 04:25:22 +0300 Subject: quantize_transform: set whole *pos struct to enable assignment-copy get_bitmap_glyph copies this struct via assignment. But to allow safe assignment-copy, it seems the whole struct must be initialized, rather than merely each of its members. Fixes CID 314186 found by Coverity Scan. --- libass/ass_render.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 7ccd5a8..3b707a7 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -590,8 +590,10 @@ static bool quantize_transform(double m[3][3], ASS_Vector *pos, offset->x = center[0] - qr[0]; offset->y = center[1] - qr[1]; } - pos->x = qr[0] >> SUBPIXEL_ORDER; - pos->y = qr[1] >> SUBPIXEL_ORDER; + *pos = (ASS_Vector) { + .x = qr[0] >> SUBPIXEL_ORDER, + .y = qr[1] >> SUBPIXEL_ORDER, + }; key->offset.x = qr[0] & ((1 << SUBPIXEL_ORDER) - 1); key->offset.y = qr[1] & ((1 << SUBPIXEL_ORDER) - 1); key->matrix_x.x = qm[0][0]; key->matrix_x.y = qm[0][1]; -- cgit v1.2.3