summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2013-02-15 16:15:38 +0100
committerJohns <johns98@gmx.net>2013-02-15 16:15:38 +0100
commit70415bf8dd9eeed5f70854f66e0eab085f80e7c0 (patch)
treeb4b49752e64a3eb4be44b07085ea88dab96fffaf
parentc9f78fc40c174dabb94592eec8e3515da27e5003 (diff)
downloadvdr-plugin-play-70415bf8dd9eeed5f70854f66e0eab085f80e7c0.tar.gz
vdr-plugin-play-70415bf8dd9eeed5f70854f66e0eab085f80e7c0.tar.bz2
Disables AVFS, which produces memory corruption.
-rw-r--r--TODO.txt2
-rw-r--r--readdir.c12
2 files changed, 10 insertions, 4 deletions
diff --git a/TODO.txt b/TODO.txt
index a941b3d..8db24e4 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,2 +1,2 @@
-
+Can autodetect color key.
ffodivxvdpau not always supported.
diff --git a/readdir.c b/readdir.c
index 2a5e400..f150783 100644
--- a/readdir.c
+++ b/readdir.c
@@ -1,7 +1,7 @@
///
/// @file readdir.c @brief directory reading module
///
-/// Copyright (c) 2012 by Johns. All Rights Reserved.
+/// Copyright (c) 2012, 2013 by Johns. All Rights Reserved.
///
/// Contributor(s):
///
@@ -23,6 +23,10 @@
#define __USE_ZZIPLIB ///< zip archives support
#define __USE_AVFS ///< A Virtual File System support
+#ifdef USE_AVFS
+#error "Version 1.0.1 of AVFS has memory corruption".
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
@@ -61,6 +65,7 @@
const char ConfigShowHiddenFiles = 0; ///< config show hidden files
static const char *BaseDir; ///< current directory
+static int BaseDirLen; ///< length of current directory name
static const NameFilter *NameFilters; ///< current name filter table
//////////////////////////////////////////////////////////////////////////////
@@ -167,7 +172,7 @@ static int FilterIsDirectory(const struct dirent *dirent)
#endif
// DT_UNKOWN or DT_LNK
- tmp = (char *)malloc(strlen(BaseDir) + strlen(dirent->d_name) + 1);
+ tmp = malloc(BaseDirLen + len + 1);
stpcpy(stpcpy(tmp, BaseDir), dirent->d_name);
dir = IsDirectory(tmp);
free(tmp);
@@ -220,7 +225,7 @@ static int FilterIsFile(const struct dirent *dirent)
#endif
// DT_UNKOWN or DT_LNK
- tmp = (char *)malloc(strlen(BaseDir) + strlen(dirent->d_name) + 1);
+ tmp = malloc(BaseDirLen + len + 1);
stpcpy(stpcpy(tmp, BaseDir), dirent->d_name);
dir = IsDirectory(tmp);
free(tmp);
@@ -272,6 +277,7 @@ int ScanDirectory(const char *name, int flag_dir, const NameFilter * filter,
// FIXME: threads remove global variables
BaseDir = name;
+ BaseDirLen = strlen(BaseDir);
NameFilters = filter;
if (!(dir = virt_opendir(name))) {