Fixed possible crash

This commit is contained in:
louis 2013-07-12 16:00:18 +02:00
parent 4a45965fb3
commit 6a6e477b7a
2 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,13 @@ cDummyGrid::cDummyGrid(cChannelColumn *c, time_t start, time_t end) : cGrid(c) {
cDummyGrid::~cDummyGrid(void) { cDummyGrid::~cDummyGrid(void) {
} }
time_t cDummyGrid::Duration(void) {
//max Duration 5h
if (end - start > 18000)
return 18000;
return (end - start);
};
void cDummyGrid::SetViewportHeight() { void cDummyGrid::SetViewportHeight() {
int viewportHeightOld = viewportHeight; int viewportHeightOld = viewportHeight;
viewportHeight = Duration() / 60 * tvguideConfig.minutePixel; viewportHeight = Duration() / 60 * tvguideConfig.minutePixel;

View File

@ -9,7 +9,7 @@ private:
time_t end; time_t end;
cString strText; cString strText;
void drawText(); void drawText();
time_t Duration(void) { return (end - start); }; time_t Duration(void);
public: public:
cDummyGrid(cChannelColumn *c, time_t start, time_t end); cDummyGrid(cChannelColumn *c, time_t start, time_t end);
virtual ~cDummyGrid(void); virtual ~cDummyGrid(void);