Skip to content
Snippets Groups Projects
Commit 95284856 authored by Adam Sampson's avatar Adam Sampson
Browse files

Fix length check in XftTextExtents*.

Commit 06a3c0ab added length checks of
the form "if (len <= 0) return;" to various Xft functions. However,
while rendering an empty string is equivalent to doing nothing, asking
for the extents of an empty string isn't -- it still needs to fill in
the extents structure. This broke text rendering in some applications
(e.g. xpdf's Motif GUI).

Check for len < 0 in XftTextExtents* instead.
parent c6309d4c
No related branches found
No related tags found
1 merge request!14Fix length check in XftTextExtents*
Pipeline #682413 passed
......@@ -123,7 +123,7 @@ XftTextExtents8 (Display *dpy,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
if (len <= 0)
if (len < 0)
return;
if (len <= NUM_LOCAL)
......@@ -154,7 +154,7 @@ XftTextExtents16 (Display *dpy,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
if (len <= 0)
if (len < 0)
return;
if (len <= NUM_LOCAL)
......@@ -185,7 +185,7 @@ XftTextExtents32 (Display *dpy,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
if (len <= 0)
if (len < 0)
return;
if (len <= NUM_LOCAL)
......@@ -219,7 +219,7 @@ XftTextExtentsUtf8 (Display *dpy,
int l;
int size;
if (len <= 0)
if (len < 0)
return;
i = 0;
......@@ -266,7 +266,7 @@ XftTextExtentsUtf16 (Display *dpy,
int l;
int size;
if (len <= 0)
if (len < 0)
return;
i = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment