1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed allocating memory for cImage

This commit is contained in:
Klaus Schmidinger 2020-11-16 15:53:53 +01:00
parent c23547c4ca
commit 6cb818c7ad
3 changed files with 8 additions and 6 deletions

View File

@ -2443,6 +2443,7 @@ Christoph Haubrich <christoph1.haubrich@arcor.de>
for adding support for HEVC-video and AC-4-audio for adding support for HEVC-video and AC-4-audio
for implementing anti-aliasing for cPixmap::DrawSlope() and cPixmap::DrawEllipse() for implementing anti-aliasing for cPixmap::DrawSlope() and cPixmap::DrawEllipse()
for reporting an unnecessary double call to Display() in cMenuRecording::RefreshRecording() 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> Pekka Mauno <pekka.mauno@iki.fi>
for fixing cSchedule::GetFollowingEvent() in case there is currently no present for fixing cSchedule::GetFollowingEvent() in case there is currently no present

View File

@ -9536,10 +9536,11 @@ Video Disk Recorder Revision History
cDvbTuner::GetSignalStats() to avoid problems with drivers that don't do this cDvbTuner::GetSignalStats() to avoid problems with drivers that don't do this
(thanks to Helmut Binder). (thanks to Helmut Binder).
2020-11-06: 2020-11-16:
- Fixed multiple recording entries in case a recording is started during the initial - Fixed multiple recording entries in case a recording is started during the initial
reading of the video directory (reported by Claus Muus). reading of the video directory (reported by Claus Muus).
- Fixed an unnecessary double call to Display() in cMenuRecording::RefreshRecording() - Fixed an unnecessary double call to Display() in cMenuRecording::RefreshRecording()
(reported by Christoph Haubrich). (reported by Christoph Haubrich).
- Fixed a crash in case an error occurs when setting a remote timer. - Fixed a crash in case an error occurs when setting a remote timer.
- Fixed allocating memory for cImage (reported by Christoph Haubrich).

10
osd.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "osd.h"
@ -1109,18 +1109,18 @@ cImage::cImage(void)
cImage::cImage(const cImage &Image) cImage::cImage(const cImage &Image)
{ {
size = Image.Size(); size = Image.Size();
int l = size.Width() * size.Height() * sizeof(tColor); int l = size.Width() * size.Height();
data = MALLOC(tColor, l); data = MALLOC(tColor, l);
memcpy(data, Image.Data(), l); memcpy(data, Image.Data(), l * sizeof(tColor));
} }
cImage::cImage(const cSize &Size, const tColor *Data) cImage::cImage(const cSize &Size, const tColor *Data)
{ {
size = Size; size = Size;
int l = size.Width() * size.Height() * sizeof(tColor); int l = size.Width() * size.Height();
data = MALLOC(tColor, l); data = MALLOC(tColor, l);
if (Data) if (Data)
memcpy(data, Data, l); memcpy(data, Data, l * sizeof(tColor));
} }
cImage::~cImage() cImage::~cImage()