Made cOsd::DestroyPixmap() "NULL proof"

This commit is contained in:
Klaus Schmidinger 2013-02-13 12:55:06 +01:00
parent e5295be30a
commit 8ef71dbbdf
2 changed files with 4 additions and 3 deletions

View File

@ -7585,7 +7585,7 @@ Video Disk Recorder Revision History
- Fixed formatting and removed some superfluous break statements in vdr.c's command - Fixed formatting and removed some superfluous break statements in vdr.c's command
line option switch. line option switch.
2013-02-12: Version 1.7.38 2013-02-13: Version 1.7.38
- Updated the Ukrainian OSD texts (thanks to Yarema Aka Knedlyk). - Updated the Ukrainian OSD texts (thanks to Yarema Aka Knedlyk).
- Updated the Estonian OSD texts (thanks to Arthur Konovalov). - Updated the Estonian OSD texts (thanks to Arthur Konovalov).
@ -7605,3 +7605,4 @@ Video Disk Recorder Revision History
characters (reported by Andre Weidemann). characters (reported by Andre Weidemann).
- Fixed the description of the OSD drawing functions DrawEllipse() (the values -5...-8 - Fixed the description of the OSD drawing functions DrawEllipse() (the values -5...-8
for the Quadrants parameter are not implemented). for the Quadrants parameter are not implemented).
- Made cOsd::DestroyPixmap() "NULL proof".

4
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 2.35 2013/02/08 10:16:47 kls Exp $ * $Id: osd.c 2.36 2013/02/13 12:52:07 kls Exp $
*/ */
#include "osd.h" #include "osd.h"
@ -1699,7 +1699,7 @@ cPixmap *cOsd::CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawP
void cOsd::DestroyPixmap(cPixmap *Pixmap) void cOsd::DestroyPixmap(cPixmap *Pixmap)
{ {
if (isTrueColor) { if (Pixmap) {
LOCK_PIXMAPS; LOCK_PIXMAPS;
for (int i = 1; i < pixmaps.Size(); i++) { // begin at 1 - don't let the background pixmap be destroyed! for (int i = 1; i < pixmaps.Size(); i++) { // begin at 1 - don't let the background pixmap be destroyed!
if (pixmaps[i] == Pixmap) { if (pixmaps[i] == Pixmap) {