vdr 1.5.16 - minor problem in font.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

DrawText() in font.c uses the method Glyph() which may return a null pointer,
but doesn't check the returned pointer.

I came across this bug, when checking a bug report from Sven Mueller:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467512

When info.vdr contains an invalid character (like in the above example a 0xA0 -
a Latin-1 NO-BREAK SPACE),  Glyph() returns null, which then causes a segfault
when dereferencing the null-pointer.

The easiest way to fix this, would probably be to ignore such invalid
characters, which is, what the attached two-line-patch will do. But maybe it's
better to replace such characters with a default character - maybe a space or a '?'.

bye,

Tobias
#! /bin/sh /usr/share/dpatch/dpatch-run
## 99_invalid-char-fix.dpatch by Tobias Grimm <tg@xxxxxxxxxx>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad vdr-1.5.16~/font.c vdr-1.5.16/font.c
--- vdr-1.5.16~/font.c	2008-02-09 12:52:25.000000000 +0100
+++ vdr-1.5.16/font.c	2008-02-29 00:50:55.000000000 +0100
@@ -258,6 +258,8 @@
            uint sym = Utf8CharGet(s, sl);
            s += sl;
            cGlyph *g = Glyph(sym, AntiAliased);
+           if (!g)
+              continue;
            int kerning = Kerning(g, prevSym);
            prevSym = sym;
            uchar *buffer = g->Bitmap();
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux