projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3546f9b
)
Exit loop when font definition contains more characters then the image has data to...
author
Ingo Ruhnke
<grumbel@gmail.com>
Sun, 3 Aug 2014 04:42:05 +0000
(06:42 +0200)
committer
Ingo Ruhnke
<grumbel@gmail.com>
Sun, 3 Aug 2014 04:42:05 +0000
(06:42 +0200)
src/video/font.cpp
patch
|
blob
|
history
diff --git
a/src/video/font.cpp
b/src/video/font.cpp
index
d9ccd08
..
00b7ec1
100644
(file)
--- a/
src/video/font.cpp
+++ b/
src/video/font.cpp
@@
-206,6
+206,12
@@
Font::loadFontSurface(
}
else
{
+ if (y + char_height > surface->h)
+ {
+ log_warning << "error: font definition contains more letter then the images: " << glyphimage << std::endl;
+ goto abort;
+ }
+
int left = x;
while (left < x + char_width && vline_empty(surface, left, y, y + char_height, 64))
left += 1;
@@
-234,7
+240,8
@@
Font::loadFontSurface(
row++;
}
}
-
+abort:
+
if( surface != NULL ) {
SDL_UnlockSurface(surface);
SDL_FreeSurface(surface);