mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Bug 335972: nscoord -> short overflow in xft code leading to crash, patch by Phil Ringnalda <philringnalda@gmail.com> and Hein Roehrig <hroehrig@gmail.com>, r=bryner, sr=roc
This commit is contained in:
parent
63879a6f99
commit
50e01a8983
@ -2178,6 +2178,14 @@ nsAutoDrawSpecBuffer::Draw(nscoord x, nscoord y, XftFont *font, FT_UInt glyph)
|
||||
if (mSpecPos >= BUFFER_LEN-1)
|
||||
Flush();
|
||||
|
||||
// Make sure the coordinates fit into the 16-bit x and y fields of
|
||||
// XftGlyphFontSpec
|
||||
NS_ASSERTION(sizeof(short) == sizeof(mSpecBuffer[mSpecPos].x), "Unexpected coordinate type");
|
||||
if ((short)x != x || (short)y != y){
|
||||
NS_WARNING("ignoring coordinate overflow");
|
||||
return;
|
||||
}
|
||||
|
||||
mSpecBuffer[mSpecPos].x = x;
|
||||
mSpecBuffer[mSpecPos].y = y;
|
||||
mSpecBuffer[mSpecPos].font = font;
|
||||
|
Loading…
Reference in New Issue
Block a user