mirror of
https://github.com/swaywm/sway.git
synced 2026-04-03 07:15:39 -04:00
common/pango: get_text_size out pointers may be NULL
Fixes:2c2a2ec380Closes: https://github.com/swaywm/sway/issues/9082 (cherry picked from commit82227d6103)
This commit is contained in:
parent
1826c38ecd
commit
07e3c06741
1 changed files with 9 additions and 1 deletions
|
|
@ -84,7 +84,15 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const PangoFontDescription *desc,
|
||||||
|
|
||||||
void get_text_size(cairo_t *cairo, const PangoFontDescription *desc, int *width, int *height,
|
void get_text_size(cairo_t *cairo, const PangoFontDescription *desc, int *width, int *height,
|
||||||
int *baseline, double scale, bool markup, const char *fmt, ...) {
|
int *baseline, double scale, bool markup, const char *fmt, ...) {
|
||||||
*width = *height = *baseline = 0;
|
if (width) {
|
||||||
|
*width = 0;
|
||||||
|
}
|
||||||
|
if (height) {
|
||||||
|
*height = 0;
|
||||||
|
}
|
||||||
|
if (baseline) {
|
||||||
|
*baseline = 0;
|
||||||
|
}
|
||||||
|
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue