osd GetBitmap() causes infinite loop

Message ID 46C1E24DA7714477BF4F2E1F22E20347@hobbes
State New
Headers

Commit Message

GerardK Dec. 15, 2012, 2:48 a.m. UTC
  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


= = = = = = = = = = = = = =
= = = = = = = = = = = = = =
  

Patch

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)