Fixed an endless loop in the DrawEllipse() functions for very small ellipses

This commit is contained in:
Klaus Schmidinger 2013-05-18 12:43:41 +02:00
parent 90f4648a7c
commit 0d14872adc
3 changed files with 9 additions and 6 deletions

View File

@ -3146,6 +3146,7 @@ Zoran Turalija <zoran.turalija@gmail.com>
Stefan Braun <louis.braun@gmx.de> Stefan Braun <louis.braun@gmx.de>
for reporting an endless loop in cTextWrapper::Set() in case the given Width is smaller for reporting an endless loop in cTextWrapper::Set() in case the given Width is smaller
than one character than one character
for reporting an endless loop in the DrawEllipse() functions for very small ellipses
Jochen Dolze <vdr@dolze.de> Jochen Dolze <vdr@dolze.de>
for changing cThread::SetIOPriority() from "best effort class" to "idle class" in order for changing cThread::SetIOPriority() from "best effort class" to "idle class" in order

View File

@ -7795,7 +7795,7 @@ Video Disk Recorder Revision History
improve overall performance when an editing process is running (thanks to Jochen improve overall performance when an editing process is running (thanks to Jochen
Dolze). Dolze).
2013-05-02: Version 2.0.2 2013-05-18: Version 2.0.2
- Fixed multiple occurrences of the same directory in the recordings list in case there - Fixed multiple occurrences of the same directory in the recordings list in case there
are directories that only differ in non-alphanumeric characters (was broken by are directories that only differ in non-alphanumeric characters (was broken by
@ -7808,3 +7808,5 @@ Video Disk Recorder Revision History
one single sequence. one single sequence.
- Fixed an error message when parsing SCR values in diseqc.conf. - Fixed an error message when parsing SCR values in diseqc.conf.
- Fixed an unexpected RCS version tag in the newplugin script. - 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).

10
osd.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #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; case 8: cy = y1; rx /= 2; break;
default: ; default: ;
} }
int TwoASquare = 2 * rx * rx; int TwoASquare = max(1, 2 * rx * rx);
int TwoBSquare = 2 * ry * ry; int TwoBSquare = max(1, 2 * ry * ry);
int x = rx; int x = rx;
int y = 0; int y = 0;
int XChange = ry * ry * (1 - 2 * rx); 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; case 8: cy = y1; rx /= 2; break;
default: ; default: ;
} }
int TwoASquare = 2 * rx * rx; int TwoASquare = max(1, 2 * rx * rx);
int TwoBSquare = 2 * ry * ry; int TwoBSquare = max(1, 2 * ry * ry);
int x = rx; int x = rx;
int y = 0; int y = 0;
int XChange = ry * ry * (1 - 2 * rx); int XChange = ry * ry * (1 - 2 * rx);