diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2020-11-16 15:53:53 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2020-11-16 15:53:53 +0100 |
commit | 6cb818c7ad20c99054f0c2d292342de99d33c2ca (patch) | |
tree | 53032ac9b816828e9edee4be487ed09470a5faf3 | |
parent | c23547c4ca729ba35139092e4c86a8f0f6454bfc (diff) | |
download | vdr-6cb818c7ad20c99054f0c2d292342de99d33c2ca.tar.gz vdr-6cb818c7ad20c99054f0c2d292342de99d33c2ca.tar.bz2 |
Fixed allocating memory for cImage
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | osd.c | 10 |
3 files changed, 8 insertions, 6 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 29cbae75..35b050f0 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2443,6 +2443,7 @@ Christoph Haubrich <christoph1.haubrich@arcor.de> for adding support for HEVC-video and AC-4-audio for implementing anti-aliasing for cPixmap::DrawSlope() and cPixmap::DrawEllipse() for reporting an unnecessary double call to Display() in cMenuRecording::RefreshRecording() + for reporting too much memory being allocated in the cImage constructors Pekka Mauno <pekka.mauno@iki.fi> for fixing cSchedule::GetFollowingEvent() in case there is currently no present @@ -9536,10 +9536,11 @@ Video Disk Recorder Revision History cDvbTuner::GetSignalStats() to avoid problems with drivers that don't do this (thanks to Helmut Binder). -2020-11-06: +2020-11-16: - Fixed multiple recording entries in case a recording is started during the initial reading of the video directory (reported by Claus Muus). - Fixed an unnecessary double call to Display() in cMenuRecording::RefreshRecording() (reported by Christoph Haubrich). - Fixed a crash in case an error occurs when setting a remote timer. +- Fixed allocating memory for cImage (reported by Christoph Haubrich). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.c 4.9 2020/10/13 13:47:10 kls Exp $ + * $Id: osd.c 4.10 2020/11/16 15:53:53 kls Exp $ */ #include "osd.h" @@ -1109,18 +1109,18 @@ cImage::cImage(void) cImage::cImage(const cImage &Image) { size = Image.Size(); - int l = size.Width() * size.Height() * sizeof(tColor); + int l = size.Width() * size.Height(); data = MALLOC(tColor, l); - memcpy(data, Image.Data(), l); + memcpy(data, Image.Data(), l * sizeof(tColor)); } cImage::cImage(const cSize &Size, const tColor *Data) { size = Size; - int l = size.Width() * size.Height() * sizeof(tColor); + int l = size.Width() * size.Height(); data = MALLOC(tColor, l); if (Data) - memcpy(data, Data, l); + memcpy(data, Data, l * sizeof(tColor)); } cImage::~cImage() |