[ANNOUNCE] DVB-S2 + H.264 support for VDR-1.5.12
Commit Message
Hi,
Reinhard Nissl schrieb:
>> The patches now include my recently released speedup patches as
>> well as an unreleased speedup patch for cAudioRepacker and
>> cVideoRepacker, because at least the latter one would have been
>> hard to extract separately.
>
> cAudioRepacker speedup patch contains a typo. Please apply the
> attached fix.
The optimized DrawRectangle() will crash when called with
incorrect coordinates, i. e. x1 > x2 or y1 > y2.
More generally such issues should be handled in Intersects() and
Covers(). The attached patch adds sanity checks to them.
Thanks to Claus Meder for reporting this issue.
Bye.
@@ -217,6 +217,8 @@ bool cBitmap::Contains(int x, int y) con
bool cBitmap::Covers(int x1, int y1, int x2, int y2) const
{
+ if (x1 > x2 || y1 > y2) // sanity check
+ return false;
x1 -= x0;
y1 -= y0;
x2 -= x0;
@@ -226,6 +228,8 @@ bool cBitmap::Covers(int x1, int y1, int
bool cBitmap::Intersects(int x1, int y1, int x2, int y2) const
{
+ if (x1 > x2 || y1 > y2) // sanity check
+ return false;
x1 -= x0;
y1 -= y0;
x2 -= x0;