summaryrefslogtreecommitdiff
path: root/osd.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-05-18 12:43:41 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2013-05-18 12:43:41 +0200
commit0d14872adcb767a729808618a1385ad4bdafb277 (patch)
tree94d9df8c4efb9c6d78afaab5b480483220d60beb /osd.c
parent90f4648a7c49ec8350e159fa9d29bb60c4f0b77a (diff)
downloadvdr-0d14872adcb767a729808618a1385ad4bdafb277.tar.gz
vdr-0d14872adcb767a729808618a1385ad4bdafb277.tar.bz2
Fixed an endless loop in the DrawEllipse() functions for very small ellipses
Diffstat (limited to 'osd.c')
-rw-r--r--osd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/osd.c b/osd.c
index cc652b62..45d4419c 100644
--- a/osd.c
+++ b/osd.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osd.c 2.38 2013/02/14 15:50:19 kls Exp $
+ * $Id: osd.c 2.38.1.1 2013/05/18 12:41:48 kls Exp $
*/
#include "osd.h"
@@ -639,8 +639,8 @@ void cBitmap::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quad
case 8: cy = y1; rx /= 2; break;
default: ;
}
- int TwoASquare = 2 * rx * rx;
- int TwoBSquare = 2 * ry * ry;
+ int TwoASquare = max(1, 2 * rx * rx);
+ int TwoBSquare = max(1, 2 * ry * ry);
int x = rx;
int y = 0;
int XChange = ry * ry * (1 - 2 * rx);
@@ -1380,8 +1380,8 @@ void cPixmapMemory::DrawEllipse(const cRect &Rect, tColor Color, int Quadrants)
case 8: cy = y1; rx /= 2; break;
default: ;
}
- int TwoASquare = 2 * rx * rx;
- int TwoBSquare = 2 * ry * ry;
+ int TwoASquare = max(1, 2 * rx * rx);
+ int TwoBSquare = max(1, 2 * ry * ry);
int x = rx;
int y = 0;
int XChange = ry * ry * (1 - 2 * rx);