mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 16:39:14 +00:00
FS-7613: fix use after free error in switch_img_txt_handle_render
This commit is contained in:
parent
9a6344c30f
commit
90bae91af7
@ -822,6 +822,7 @@ SWITCH_DECLARE(uint32_t) switch_img_txt_handle_render(switch_img_txt_handle_t *h
|
|||||||
FT_Face face;
|
FT_Face face;
|
||||||
uint32_t width = 0;
|
uint32_t width = 0;
|
||||||
int this_x = 0, last_x = 0, space = 0;
|
int this_x = 0, last_x = 0, space = 0;
|
||||||
|
uint32_t ret;
|
||||||
|
|
||||||
if (zstr(text)) return 0;
|
if (zstr(text)) return 0;
|
||||||
|
|
||||||
@ -920,9 +921,11 @@ SWITCH_DECLARE(uint32_t) switch_img_txt_handle_render(switch_img_txt_handle_t *h
|
|||||||
pen.y += slot->advance.y >> 6;
|
pen.y += slot->advance.y >> 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = width + slot->bitmap.width * 3;
|
||||||
|
|
||||||
FT_Done_Face(face);
|
FT_Done_Face(face);
|
||||||
|
|
||||||
return width + slot->bitmap.width * 3;
|
return ret;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user