[vlc-commits] commit: Contribs: try to fix CDDB crash on Windows (Jean-Baptiste Kempf )
git at videolan.org
git at videolan.org
Sat Dec 4 20:38:06 CET 2010
vlc/vlc-1.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Nov 28 20:43:47 2010 +0100| [bede4ad3a4a3bebfd80b730b237e6df5c487e33c] | committer: Jean-Baptiste Kempf
Contribs: try to fix CDDB crash on Windows
Ref #3804
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=bede4ad3a4a3bebfd80b730b237e6df5c487e33c
---
extras/contrib/src/Makefile | 1 +
.../contrib/src/Patches/libcddb-getenv-crash.patch | 23 ++++++++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/extras/contrib/src/Makefile b/extras/contrib/src/Makefile
index 8ff21c3..8703ed5 100644
--- a/extras/contrib/src/Makefile
+++ b/extras/contrib/src/Makefile
@@ -1473,6 +1473,7 @@ libcddb: libcddb-$(CDDB_VERSION).tar.bz2
ifdef HAVE_WIN32
(cd $@; patch -p0 < ../Patches/libcddb-win32.patch )
endif
+ patch -p0 < Patches/libcddb-getenv-crash.patch
(cd $@; autoreconf -fisv)
ifdef HAVE_WIN32
diff --git a/extras/contrib/src/Patches/libcddb-getenv-crash.patch b/extras/contrib/src/Patches/libcddb-getenv-crash.patch
new file mode 100644
index 0000000..48888ef
--- /dev/null
+++ b/extras/contrib/src/Patches/libcddb-getenv-crash.patch
@@ -0,0 +1,23 @@
+--- libcddb/lib/cddb_conn.c 2006-10-15 13:53:11.000000000 +0200
++++ libcddb.new/lib/cddb_conn.c 2010-11-28 21:03:39.012749230 +0100
+@@ -100,9 +100,17 @@
+ c->use_cache = CACHE_ON;
+ /* construct cache dir '$HOME/[DEFAULT_CACHE]' */
+ s = getenv("HOME");
+- c->cache_dir = (char*)malloc(strlen(s) + 1 + sizeof(DEFAULT_CACHE) + 1);
+- sprintf(c->cache_dir, "%s/%s", s, DEFAULT_CACHE);
+- c->cache_read = FALSE;
++ if( s )
++ {
++ c->cache_dir = (char*)malloc(strlen(s) + 1 + sizeof(DEFAULT_CACHE) + 1);
++ sprintf(c->cache_dir, "%s/%s", s, DEFAULT_CACHE);
++ c->cache_read = FALSE;
++ }
++ else
++ {
++ c->cache_dir = NULL;
++ c->use_cache = CACHE_OFF;
++ }
+
+ /* use anonymous at localhost */
+ c->user = strdup(DEFAULT_USER);
More information about the vlc-commits
mailing list