diff options
author | rcombs <rcombs@rcombs.me> | 2021-05-05 01:48:44 -0500 |
---|---|---|
committer | Oneric <oneric@oneric.stub> | 2021-05-30 23:55:43 +0200 |
commit | 2b00b4e7c63b498449d2acf3ce490fd7c8c65a28 (patch) | |
tree | f48b7aae5f6b241cd4ae0e95d32a00e6d21d03b3 | |
parent | 96a920a76b9d16572329547c29f728b4436f741c (diff) | |
download | libass-2b00b4e7c63b498449d2acf3ce490fd7c8c65a28.tar.bz2 libass-2b00b4e7c63b498449d2acf3ce490fd7c8c65a28.tar.xz |
Fix some format string bugs
- ass_drawing was logging size_t as %d
- ass_font was logging ASS_StringView as %s (could crash!)
-rw-r--r-- | libass/ass_drawing.c | 2 | ||||
-rw-r--r-- | libass/ass_font.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libass/ass_drawing.c b/libass/ass_drawing.c index 1af250d..c7f99b7 100644 --- a/libass/ass_drawing.c +++ b/libass/ass_drawing.c @@ -257,7 +257,7 @@ bool ass_drawing_parse(ASS_Outline *outline, ASS_Rect *cbox, if (lib) ass_msg(lib, MSGL_V, - "Parsed drawing with %d points and %d segments", + "Parsed drawing with %zu points and %zu segments", outline->n_points, outline->n_segments); drawing_free_tokens(tokens); diff --git a/libass/ass_font.c b/libass/ass_font.c index 7d79d2e..7c1e76d 100644 --- a/libass/ass_font.c +++ b/libass/ass_font.c @@ -474,7 +474,7 @@ int ass_font_get_index(ASS_FontSelector *fontsel, ASS_Font *font, int face_idx; ass_msg(font->library, MSGL_INFO, "Glyph 0x%X not found, selecting one more " - "font for (%s, %d, %d)", symbol, font->desc.family, + "font for (%.*s, %d, %d)", symbol, (int) font->desc.family.len, font->desc.family.str, font->desc.bold, font->desc.italic); face_idx = *face_index = add_face(fontsel, font, symbol); if (face_idx >= 0) { @@ -491,8 +491,8 @@ int ass_font_get_index(ASS_FontSelector *fontsel, ASS_Font *font, } if (index == 0) { ass_msg(font->library, MSGL_ERR, - "Glyph 0x%X not found in font for (%s, %d, %d)", - symbol, font->desc.family, font->desc.bold, + "Glyph 0x%X not found in font for (%.*s, %d, %d)", + symbol, (int) font->desc.family.len, font->desc.family.str, font->desc.bold, font->desc.italic); } } |