summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-01-16 17:46:08 +0100
committerlouis <louis.braun@gmx.de>2014-01-16 17:46:08 +0100
commit2c72feabbdc68db8774eaff831171f616d3835f7 (patch)
treece86d2f17b0fb91ad56c77c4ecc68214c91511a9
parenta7c76c8a23feecf86c736d751d76127266839a54 (diff)
downloadvdr-plugin-tvguide-2c72feabbdc68db8774eaff831171f616d3835f7.tar.gz
vdr-plugin-tvguide-2c72feabbdc68db8774eaff831171f616d3835f7.tar.bz2
additional check when scaling image
-rw-r--r--imagecache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/imagecache.c b/imagecache.c
index 93baa9d..5c4c50a 100644
--- a/imagecache.c
+++ b/imagecache.c
@@ -408,6 +408,8 @@ void cImageCache::InsertIntoGridCache(std::string name, int width, int height, b
}
cImage *cImageCache::CreateGrid(int width, int height, bool active) {
+ if (width > geoManager.osdWidth || width < 6 || height > geoManager.osdHeight || height < 6)
+ return NULL;
Image *currentGridBuffer = NULL;
if (active)
currentGridBuffer = &bufferGridActive;
@@ -424,6 +426,7 @@ cImage *cImageCache::CreateGrid(int width, int height, bool active) {
tColor *imgData = (tColor *)image->Data();
if (w != width || h != height) {
ImageScaler scaler;
+ //esyslog("tvguide: imagescaler parameters: width %d, height %d, w %d, h %d", width, height, w, h);
scaler.SetImageParameters(imgData, width, width, height, w, h);
for (const void *pixels_end = &pixels[w*h]; pixels < pixels_end; ++pixels)
scaler.PutSourcePixel(pixels->blue / ((MaxRGB + 1) / 256),