[ANNOUNCE] DVB-S2 + H.264 support for VDR-1.5.12

Message ID 47814CCD.7030407@gmx.de
State New
Headers

Commit Message

Reinhard Nissl Jan. 6, 2008, 9:49 p.m. UTC
  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.
  

Patch

--- ../vdr-1.5.12-dvbs2-other/osd.c	2008-01-01 22:55:18.000000000 +0100
+++ osd.c	2008-01-06 22:39:33.000000000 +0100
@@ -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;