diff --git a/gfx/thebes/src/gfxWindowsFonts.cpp b/gfx/thebes/src/gfxWindowsFonts.cpp
--- a/gfx/thebes/src/gfxWindowsFonts.cpp
+++ b/gfx/thebes/src/gfxWindowsFonts.cpp
@@ -1531,19 +1531,19 @@ gfxWindowsFontGroup::MakeTextRun(const P
                        reinterpret_cast<const char*>(aString), aLength);
     }
     else {
         nsDependentCSubstring cString(reinterpret_cast<const char*>(aString),
                                   reinterpret_cast<const char*>(aString + aLength));
         nsAutoString utf16;
         AppendASCIItoUTF16(cString, utf16);
         if (isComplex) {
-            InitTextRunUniscribe(aParams->mContext, textRun, utf16.get(), aLength);
+            InitTextRunUniscribe(aParams->mContext, textRun, utf16.get(), utf16.Length());
         } else {
-            InitTextRunGDI(aParams->mContext, textRun, utf16.get(), aLength);
+            InitTextRunGDI(aParams->mContext, textRun, utf16.get(), utf16.Length());
         }
     }
 
     textRun->FetchGlyphExtents(aParams->mContext);
 
     return textRun;
 }
 