From 477a606c4dfb9b77c1c914d3542fd2471c1d3834 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Mon, 23 Jan 2017 15:16:42 +0000 Subject: [PATCH] Fix segfault when server returns a getblock with size 0 --- player.cc | 4 ++-- vdr.cc | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 player.cc mode change 100644 => 100755 vdr.cc diff --git a/player.cc b/player.cc old mode 100644 new mode 100755 index 3811a76..c93c733 --- a/player.cc +++ b/player.cc @@ -1375,8 +1375,8 @@ void Player::threadFeedScan() logger->log("Player", Log::DEBUG, "XXX Got frame"); threadBuffer = vdr->getBlock(filePos, iframeLength, &amountReceived); - - if (!vdr->isConnected()) + + if (!vdr->isConnected() || !amountReceived) { if (threadBuffer) free(threadBuffer); doConnectionLost(); diff --git a/vdr.cc b/vdr.cc old mode 100644 new mode 100755 index ee19f82..db0dc9d --- a/vdr.cc +++ b/vdr.cc @@ -960,6 +960,7 @@ UCHAR* VDR::getBlock(ULLONG position, UINT maxAmount, UINT* amountReceived) if (vresp->serverError()) { logger->log("VDR", Log::DEBUG, "Detected getblock 0"); + *amountReceived = 0; delete vresp; return NULL; } -- 2.39.5