From e535cdbe09d9c13d79cd6722aafca5798b7d1e35 Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Tue, 1 Jun 2004 21:02:41 +0000 Subject: - fixed possible segfault when showing language logo (happened when channel was not available) - fixed some memory leaks - fixed "too many colors used in palette" warning for non-imlib-users --- render.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index f4485d7..c317a82 100644 --- a/render.c +++ b/render.c @@ -1,5 +1,5 @@ /* - * $Id: render.c,v 1.14 2004/06/01 17:25:38 lordjaxom Exp $ + * $Id: render.c,v 1.15 2004/06/01 21:02:38 lordjaxom Exp $ */ #include "render.h" @@ -195,7 +195,7 @@ void cText2SkinRender::DrawBackground(const POINT &Pos, const SIZE &Size, const } if (image) - mOsd->DrawBitmap(Pos.x, Pos.y, bm); + DrawBitmap(mOsd, Pos.x, Pos.y, bm); else mOsd->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, Bg ? *Bg : 0); } @@ -209,7 +209,7 @@ void cText2SkinRender::DrawImage(const POINT &Pos, const SIZE &Size, const tColo if (Bg) bm.SetColor(0, *Bg); if (Fg) bm.SetColor(1, *Fg); //mOsd->DrawRectangle(Pos.x, Pos.y, Pos.x + Size.w - 1, Pos.y + Size.h - 1, bm.Color(0)); - mOsd->DrawBitmap(Pos.x, Pos.y, bm); + DrawBitmap(mOsd, Pos.x, Pos.y, bm); } free(p); } @@ -323,8 +323,10 @@ void cText2SkinRender::DisplayLanguage(cText2SkinItem *Item) { ++i; } printf("\n"); - string path = Item->Path() + "/" + tracks[current] + "." + Item->Type(); - DrawImage(Item->Pos(), Item->Size(), Item->Bg(), Item->Fg(), path); + if (current < i) { + string path = Item->Path() + "/" + tracks[current] + "." + Item->Type(); + DrawImage(Item->Pos(), Item->Size(), Item->Bg(), Item->Fg(), path); + } } } @@ -353,6 +355,7 @@ void cText2SkinRender::DisplayTime(cText2SkinItem *Item) { char *text = strdup(DayDateTime(time(NULL))); text[18] = '\0'; DrawText(Item->Pos(), Item->Size(), Item->Fg(), ItemText(Item, text + 13), Item->Font(), Item->Align()); + free(text); } void cText2SkinRender::DisplayChannelNumberName(cText2SkinItem *Item) { -- cgit v1.2.3