diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 71e63474..ccd83b16 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2206,6 +2206,7 @@ Marko M for reporting a flaw in initializing cDvbPlayerControl and cTransferControl for reporting a possible call to poll() in cSectionHandler::Action() without any filters + for avoiding the memcpy() call in cGlyph::cGlyph() if the bitmap is empty Patrick Rother for reporting a bug in defining timers that only differ in the day of week diff --git a/HISTORY b/HISTORY index 7e096ea9..86b83a7a 100644 --- a/HISTORY +++ b/HISTORY @@ -9826,3 +9826,5 @@ Video Disk Recorder Revision History - Fixed initializing cDvbPlayerControl and cTransferControl (reported by Marko Mäkelä). - Now avoiding calling poll() in cSectionHandler::Action() if there are no filters (reported by Marko Mäkelä). +- Now avoiding the memcpy() call in cGlyph::cGlyph() if the bitmap is empty (thanks + to Marko Mäkelä). diff --git a/font.c b/font.c index 8b37798c..42700afe 100644 --- a/font.c +++ b/font.c @@ -6,7 +6,7 @@ * * BiDi support by Osama Alrawab @2008 Tripoli-Libya. * - * $Id: font.c 5.1 2021/12/20 13:19:52 kls Exp $ + * $Id: font.c 5.2 2022/12/06 12:30:13 kls Exp $ */ #include "font.h" @@ -74,7 +74,8 @@ cGlyph::cGlyph(uint CharCode, FT_GlyphSlotRec_ *GlyphData) rows = GlyphData->bitmap.rows; pitch = GlyphData->bitmap.pitch; bitmap = MALLOC(uchar, rows * pitch); - memcpy(bitmap, GlyphData->bitmap.buffer, rows * pitch); + if (int bytes = rows * pitch) + memcpy(bitmap, GlyphData->bitmap.buffer, bytes); } cGlyph::~cGlyph()