]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7613: fix use after free error in switch_img_txt_handle_render
authorMichael Jerris <mike@jerris.com>
Fri, 5 Jun 2015 22:57:06 +0000 (17:57 -0500)
committerBrian West <brian@freeswitch.org>
Fri, 5 Jun 2015 22:57:06 +0000 (17:57 -0500)
src/switch_core_video.c

index 61fa8fae9663e1df1e361c3104d2f3df5e34685c..212267f46d707da8c80f5e878a1a26cdf0575066 100644 (file)
@@ -822,6 +822,7 @@ SWITCH_DECLARE(uint32_t) switch_img_txt_handle_render(switch_img_txt_handle_t *h
        FT_Face face;
        uint32_t width = 0;
        int this_x = 0, last_x = 0, space = 0;
+       uint32_t ret;
 
        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;
        }
 
+       ret = width + slot->bitmap.width * 3;
+
        FT_Done_Face(face);
 
-       return width + slot->bitmap.width * 3;
+       return ret;
 #else
        return 0;
 #endif