projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6e75ba
)
video: freetype: Fix a memory leak with a bad parameter
author
Simon Glass
<sjg@chromium.org>
Mon, 22 Feb 2016 04:10:26 +0000
(21:10 -0700)
committer
Anatolij Gustschin
<agust@denx.de>
Mon, 22 Feb 2016 13:41:22 +0000
(14:41 +0100)
Make sure to free memory used when the scale facture is incorrect.
Reported-by: Coverity (CID: 24068)
Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/video/stb_truetype.h
patch
|
blob
|
history
diff --git
a/drivers/video/stb_truetype.h
b/drivers/video/stb_truetype.h
index 91d8e6f905c76209b56f6b5113df1d4e696c3c81..26e483cf566ac8a20898e52ebc25e972f480d178 100644
(file)
--- a/
drivers/video/stb_truetype.h
+++ b/
drivers/video/stb_truetype.h
@@
-2426,7
+2426,10
@@
STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info
if (scale_x == 0) scale_x = scale_y;
if (scale_y == 0) {
- if (scale_x == 0) return NULL;
+ if (scale_x == 0) {
+ STBTT_free(vertices, info->userdata);
+ return NULL;
+ }
scale_y = scale_x;
}