diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d2cf51e0..3a60a001 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2203,6 +2203,7 @@ Marko M for reporting a compiler warning about the use of strncpy() in strreplace() for adding support for kernel based LIRC driver for reporting a possible heap-use-after-free in cDvbTuner::Action() + for reporting a flaw in initializing cDvbPlayerControl and cTransferControl Patrick Rother for reporting a bug in defining timers that only differ in the day of week diff --git a/HISTORY b/HISTORY index b80c34aa..6d45c5cb 100644 --- a/HISTORY +++ b/HISTORY @@ -9823,3 +9823,4 @@ Video Disk Recorder Revision History - Fixed a faulty 'Timer still recording' query when canceling an editing job. - Added code for the 'qks' audio track (thanks to Johann Friedrichs). - Fixed a possible heap-use-after-free in cDvbTuner::Action() (reported by Marko Mäkelä). +- Fixed initializing cDvbPlayerControl and cTransferControl (reported by Marko Mäkelä). diff --git a/dvbplayer.c b/dvbplayer.c index 2ee846b6..ee6e501c 100644 --- a/dvbplayer.c +++ b/dvbplayer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbplayer.c 5.1 2022/01/13 21:41:41 kls Exp $ + * $Id: dvbplayer.c 5.2 2022/12/05 14:45:51 kls Exp $ */ #include "dvbplayer.h" @@ -981,8 +981,10 @@ bool cDvbPlayer::GetReplayMode(bool &Play, bool &Forward, int &Speed) // --- cDvbPlayerControl ----------------------------------------------------- cDvbPlayerControl::cDvbPlayerControl(const char *FileName, bool PauseLive) -:cControl(player = new cDvbPlayer(FileName, PauseLive)) +:cControl(NULL, PauseLive) { + player = new cDvbPlayer(FileName, PauseLive); + SetPlayer(player); } cDvbPlayerControl::~cDvbPlayerControl() diff --git a/player.h b/player.h index 22c748bd..5507a4fe 100644 --- a/player.h +++ b/player.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: player.h 4.5 2020/05/18 16:47:29 kls Exp $ + * $Id: player.h 5.1 2022/12/05 14:45:51 kls Exp $ */ #ifndef __PLAYER_H @@ -107,6 +107,7 @@ public: ///< Deletion of the marks themselves is handled separately, calling ///< this function merely tells the player to no longer display the ///< marks, if it has any. + void SetPlayer(cPlayer *Player) { player = Player; } double FramesPerSecond(void) const { return player ? player->FramesPerSecond() : DEFAULTFRAMESPERSECOND; } bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false) const { return player ? player->GetIndex(Current, Total, SnapToIFrame) : false; } bool GetFrameNumber(int &Current, int &Total) const { return player ? player->GetFrameNumber(Current, Total) : false; } diff --git a/transfer.c b/transfer.c index 88931e58..1aadcc47 100644 --- a/transfer.c +++ b/transfer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: transfer.c 4.2 2017/12/07 15:00:33 kls Exp $ + * $Id: transfer.c 5.1 2022/12/05 14:45:51 kls Exp $ */ #include "transfer.h" @@ -68,8 +68,10 @@ void cTransfer::Receive(const uchar *Data, int Length) cDevice *cTransferControl::receiverDevice = NULL; cTransferControl::cTransferControl(cDevice *ReceiverDevice, const cChannel *Channel) -:cControl(transfer = new cTransfer(Channel), true) +:cControl(NULL, true) { + transfer = new cTransfer(Channel); + SetPlayer(transfer); ReceiverDevice->AttachReceiver(transfer); receiverDevice = ReceiverDevice; }