Avoiding a zero sized array in cDevice::GetDevice()

This commit is contained in:
Klaus Schmidinger 2022-12-07 09:38:05 +01:00
parent 5b176f97a4
commit 15f13ac936
3 changed files with 5 additions and 3 deletions

View File

@ -2209,6 +2209,7 @@ Marko M
for avoiding the memcpy() call in cGlyph::cGlyph() if the bitmap is empty
for avoiding unnecessary processing in cDvbSubtitleConverter::FinishPage() if there
are no areas
for avoiding a zero sized array in cDevice::GetDevice()
Patrick Rother <krd-vdr@gulu.net>
for reporting a bug in defining timers that only differ in the day of week

View File

@ -9816,7 +9816,7 @@ Video Disk Recorder Revision History
- Added missing rounding when dividing frequencies in processing the NIT (thanks to
Winfried Köhler).
2022-12-06:
2022-12-07:
- Fixed a compiler warning.
- Fixed generating the index file in the cutter (reported by Christoph Haubrich).
@ -9830,3 +9830,4 @@ Video Disk Recorder Revision History
to Marko Mäkelä).
- Now avoiding unnecessary processing in cDvbSubtitleConverter::FinishPage() if there
are no areas (thanks to Marko Mäkelä).
- Avoiding a zero sized array in cDevice::GetDevice() (thanks to Marko Mäkelä).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.c 5.5 2022/01/24 16:53:45 kls Exp $
* $Id: device.c 5.6 2022/12/07 09:38:05 kls Exp $
*/
#include "device.h"
@ -249,7 +249,7 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
{
// Collect the current priorities of all CAM slots that can decrypt the channel:
int NumCamSlots = CamSlots.Count();
int SlotPriority[NumCamSlots];
int SlotPriority[NumCamSlots + 1]; // +1 to avoid a zero sized array in case there are no CAM slots
int NumUsableSlots = 0;
bool InternalCamNeeded = false;
if (Channel->Ca() >= CA_ENCRYPTED_MIN) {