mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed handling error conditions in the index file
This commit is contained in:
parent
8cde8464eb
commit
ea1ad945b4
@ -2536,6 +2536,7 @@ Markus Ehrnsperger <markus.ehrnsperger@googlemail.com>
|
|||||||
for reporting a problem with missing 'INCLUDES += -I$(DVBDIR)/include' in an existing
|
for reporting a problem with missing 'INCLUDES += -I$(DVBDIR)/include' in an existing
|
||||||
Make.config
|
Make.config
|
||||||
for reporting a bug in error handling when loading a plugin
|
for reporting a bug in error handling when loading a plugin
|
||||||
|
for reporting a possible crash in cIndexFile::GetClosestIFrame()
|
||||||
|
|
||||||
Werner Färber <w.faerber@gmx.de>
|
Werner Färber <w.faerber@gmx.de>
|
||||||
for reporting a bug in handling the cPluginManager::Active() result when pressing
|
for reporting a bug in handling the cPluginManager::Active() result when pressing
|
||||||
|
3
HISTORY
3
HISTORY
@ -9766,7 +9766,7 @@ Video Disk Recorder Revision History
|
|||||||
(reported by Timo Weingärtner).
|
(reported by Timo Weingärtner).
|
||||||
- Official release.
|
- Official release.
|
||||||
|
|
||||||
2022-01-18:
|
2022-01-24:
|
||||||
|
|
||||||
- Replaced strncpy() with memcpy() in strreplace() to avoid a compiler warning
|
- Replaced strncpy() with memcpy() in strreplace() to avoid a compiler warning
|
||||||
(reported by Marco Mäkelä).
|
(reported by Marco Mäkelä).
|
||||||
@ -9774,3 +9774,4 @@ Video Disk Recorder Revision History
|
|||||||
- Updated the Italian OSD texts (thanks to Diego Pierotto).
|
- Updated the Italian OSD texts (thanks to Diego Pierotto).
|
||||||
- Added some missing "AUTO" values to vdr.5 (thanks to Winfried Köhler).
|
- Added some missing "AUTO" values to vdr.5 (thanks to Winfried Köhler).
|
||||||
- Fixed handling zero bytes in cH264Parser (thanks to Christoph Haubrich).
|
- Fixed handling zero bytes in cH264Parser (thanks to Christoph Haubrich).
|
||||||
|
- Fixed handling error conditions in the index file (reported by Markus Ehrnsperger).
|
||||||
|
11
recording.c
11
recording.c
@ -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: recording.c 5.13 2021/07/01 15:40:46 kls Exp $
|
* $Id: recording.c 5.14 2022/01/24 10:44:21 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "recording.h"
|
#include "recording.h"
|
||||||
@ -2604,6 +2604,8 @@ cIndexFile::cIndexFile(const char *FileName, bool Record, bool IsPesRecording, b
|
|||||||
if (safe_read(f, index, size_t(buf.st_size)) != buf.st_size) {
|
if (safe_read(f, index, size_t(buf.st_size)) != buf.st_size) {
|
||||||
esyslog("ERROR: can't read from file '%s'", *fileName);
|
esyslog("ERROR: can't read from file '%s'", *fileName);
|
||||||
free(index);
|
free(index);
|
||||||
|
size = 0;
|
||||||
|
last = -1;
|
||||||
index = NULL;
|
index = NULL;
|
||||||
}
|
}
|
||||||
else if (isPesRecording)
|
else if (isPesRecording)
|
||||||
@ -2617,8 +2619,11 @@ cIndexFile::cIndexFile(const char *FileName, bool Record, bool IsPesRecording, b
|
|||||||
else
|
else
|
||||||
LOG_ERROR_STR(*fileName);
|
LOG_ERROR_STR(*fileName);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
esyslog("ERROR: can't allocate %zd bytes for index '%s'", size * sizeof(tIndexTs), *fileName);
|
esyslog("ERROR: can't allocate %zd bytes for index '%s'", size * sizeof(tIndexTs), *fileName);
|
||||||
|
size = 0;
|
||||||
|
last = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2817,7 +2822,7 @@ int cIndexFile::GetNextIFrame(int Index, bool Forward, uint16_t *FileNumber, off
|
|||||||
|
|
||||||
int cIndexFile::GetClosestIFrame(int Index)
|
int cIndexFile::GetClosestIFrame(int Index)
|
||||||
{
|
{
|
||||||
if (last > 0) {
|
if (index && last > 0) {
|
||||||
Index = constrain(Index, 0, last);
|
Index = constrain(Index, 0, last);
|
||||||
if (index[Index].independent)
|
if (index[Index].independent)
|
||||||
return Index;
|
return Index;
|
||||||
|
Loading…
Reference in New Issue
Block a user