osd GetBitmap() causes infinite loop
Commit Message
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
= = = = = = = = = = = = = =
= = = = = = = = = = = = = =
@@ -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)