summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-05-18 12:39:59 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2013-05-18 12:39:59 +0200
commitcc6c05fcf2e0f154f262189c2428019570b95ec1 (patch)
tree9e64eac9abb19e9aef607a540519141d427c4f68
parentf6adb3220266e2fc297d582c5fa24483890dc0c9 (diff)
downloadvdr-cc6c05fcf2e0f154f262189c2428019570b95ec1.tar.gz
vdr-cc6c05fcf2e0f154f262189c2428019570b95ec1.tar.bz2
Fixed an endless loop in the DrawEllipse() functions for very small ellipses
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY4
-rw-r--r--osd.c10
3 files changed, 9 insertions, 6 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 6fff3185..e1e20c2d 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -3147,6 +3147,7 @@ Zoran Turalija <zoran.turalija@gmail.com>
Stefan Braun <louis.braun@gmx.de>
for reporting an endless loop in cTextWrapper::Set() in case the given Width is smaller
than one character
+ for reporting an endless loop in the DrawEllipse() functions for very small ellipses
Jochen Dolze <vdr@dolze.de>
for changing cThread::SetIOPriority() from "best effort class" to "idle class" in order
diff --git a/HISTORY b/HISTORY
index fdffafa7..5d95385e 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7809,7 +7809,7 @@ Video Disk Recorder Revision History
- Fixed an error message when parsing SCR values in diseqc.conf.
- Fixed an unexpected RCS version tag in the newplugin script.
-2013-05-02: Version 2.1.1
+2013-05-18: Version 2.1.1
- Fixed initializing cDevice::keepTracks.
- Fixed an endless loop in cTextWrapper::Set() in case the given Width is smaller than
@@ -7836,3 +7836,5 @@ Video Disk Recorder Revision History
one single sequence (reported by Halim Sahin).
- Fixed an error message when parsing SCR values in diseqc.conf.
- Fixed an unexpected RCS version tag in the newplugin script.
+- Fixed an endless loop in the DrawEllipse() functions for very small ellipses (reported
+ by Stefan Braun).
diff --git a/osd.c b/osd.c
index cc652b62..c266092b 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 3.1 2013/05/18 12:33:16 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);