From 2c72feabbdc68db8774eaff831171f616d3835f7 Mon Sep 17 00:00:00 2001 From: louis Date: Thu, 16 Jan 2014 17:46:08 +0100 Subject: additional check when scaling image --- imagecache.c | 3 +++ 1 file changed, 3 insertions(+) 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), -- cgit v1.2.3