summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2021-05-02 04:25:22 +0300
committerOleg Oshmyan <chortos@inbox.lv>2021-05-02 04:30:59 +0300
commitc9deee751787aaca465daaea252504ec1f500beb (patch)
tree3c66406949a03d7165f71b6b0b05fa0d4a35f38d
parentd325c633f4ac32fcb4c76a3fb5926737a45c38d0 (diff)
downloadlibass-c9deee751787aaca465daaea252504ec1f500beb.tar.bz2
libass-c9deee751787aaca465daaea252504ec1f500beb.tar.xz
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.
-rw-r--r--libass/ass_render.c6
1 files 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];