[vdr] [PATCH] osd GetBitmap() causes infinite loop

GerardK gerardk5 at verizon.net
Sat Dec 15 03:48:57 CET 2012


Hi there

The softdevice plugin was getting stuck in an infinite loop because of
a bogus return from the GetBitmap() function in osd.c.
This function should always return NULL when the 'Area' argument is
greater than or equal to 'numBitmaps'.

Regards -- Gerard


= = = = = = = = = = = = = =
diff -pruN a/osd.c b/osd.c
--- a/osd.c    2012-06-09 07:37:24.000000000 -0700
+++ b/osd.c    2012-12-14 17:36:27.000000000 -0800
@@ -1683,9 +1683,9 @@ void cOsd::SetAntiAliasGranularity(uint

 cBitmap *cOsd::GetBitmap(int Area)
 {
-  if (isTrueColor)
-     Area = 0; // returns the dummy bitmap
-  return Area < numBitmaps ? bitmaps[Area] : NULL;
+  /* TrueColor gets the dummy bitmap */
+  return Area < numBitmaps ? (isTrueColor ? bitmaps[0] : bitmaps[Area]) \
+            : NULL;
 }

 cPixmap *cOsd::CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort)
= = = = = = = = = = = = = =




More information about the vdr mailing list