From bb23c68e71d504025f72e9a337b1bf8001477a4f Mon Sep 17 00:00:00 2001 From: Simon Montagu Date: Thu, 14 Aug 2008 11:20:46 +0300 Subject: [PATCH] Prevent crash with long string of Indic characters. Bug 445711, r=pavlov --- gfx/src/thebes/crashtests/445711.html | 11 +++++++++++ gfx/src/thebes/crashtests/crashtests.list | 1 + gfx/thebes/src/gfxWindowsFonts.cpp | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 gfx/src/thebes/crashtests/445711.html diff --git a/gfx/src/thebes/crashtests/445711.html b/gfx/src/thebes/crashtests/445711.html new file mode 100644 index 00000000000..6ebd37eef20 --- /dev/null +++ b/gfx/src/thebes/crashtests/445711.html @@ -0,0 +1,11 @@ + + + + + Tamil testcase + + +

ௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌௌ

+ + diff --git a/gfx/src/thebes/crashtests/crashtests.list b/gfx/src/thebes/crashtests/crashtests.list index 1dc8621821c..b261f593665 100644 --- a/gfx/src/thebes/crashtests/crashtests.list +++ b/gfx/src/thebes/crashtests/crashtests.list @@ -1,2 +1,3 @@ load 306902-1.xml load 383872-1.svg +load 445711.html diff --git a/gfx/thebes/src/gfxWindowsFonts.cpp b/gfx/thebes/src/gfxWindowsFonts.cpp index f8d85ed457b..fb702741c45 100644 --- a/gfx/thebes/src/gfxWindowsFonts.cpp +++ b/gfx/thebes/src/gfxWindowsFonts.cpp @@ -1332,9 +1332,9 @@ public: mAttr.Elements(), &mNumGlyphs); if (rv == E_OUTOFMEMORY) { + mMaxGlyphs *= 2; mGlyphs.SetLength(mMaxGlyphs); mAttr.SetLength(mMaxGlyphs); - mMaxGlyphs *= 2; continue; }