Now avoiding the memcpy() call in cGlyph::cGlyph() if the bitmap is empty

This commit is contained in:
Klaus Schmidinger 2022-12-06 12:30:13 +01:00
parent c06d2389e9
commit 0bb6f87776
3 changed files with 6 additions and 2 deletions

View File

@ -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 <krd-vdr@gulu.net>
for reporting a bug in defining timers that only differ in the day of week

View File

@ -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ä).

5
font.c
View File

@ -6,7 +6,7 @@
*
* BiDi support by Osama Alrawab <alrawab@hotmail.com> @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()