[vlc-commits] contrib: fix zvbi compilation on Win32

Rémi Denis-Courmont git at videolan.org
Sun Nov 6 10:35:30 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Nov  6 11:34:33 2011 +0200| [ade7f0e4fdb944ce0a3b144fa390cf1be525b350] | committer: Rémi Denis-Courmont

contrib: fix zvbi compilation on Win32

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ade7f0e4fdb944ce0a3b144fa390cf1be525b350
---

 contrib/src/zvbi/rules.mak            |    2 ++
 contrib/src/zvbi/zvbi-ioctl.patch     |   19 +++++++++++++++++++
 contrib/src/zvbi/zvbi-ssize_max.patch |   28 ++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/contrib/src/zvbi/rules.mak b/contrib/src/zvbi/rules.mak
index 913cc8f..e1c9d38 100644
--- a/contrib/src/zvbi/rules.mak
+++ b/contrib/src/zvbi/rules.mak
@@ -15,6 +15,8 @@ $(TARBALLS)/zvbi-$(ZVBI_VERSION).tar.bz2:
 
 zvbi: zvbi-$(ZVBI_VERSION).tar.bz2 .sum-zvbi
 	$(UNPACK)
+	$(APPLY) $(SRC)/zvbi/zvbi-ssize_max.patch
+	$(APPLY) $(SRC)/zvbi/zvbi-ioctl.patch
 ifdef HAVE_WIN32
 	$(APPLY) $(SRC)/zvbi/zvbi-win32.patch
 endif
diff --git a/contrib/src/zvbi/zvbi-ioctl.patch b/contrib/src/zvbi/zvbi-ioctl.patch
new file mode 100644
index 0000000..2b0e42d
--- /dev/null
+++ b/contrib/src/zvbi/zvbi-ioctl.patch
@@ -0,0 +1,19 @@
+diff -ru zvbi.orig/contrib/ntsc-cc.c zvbi/contrib/ntsc-cc.c
+--- zvbi.orig/contrib/ntsc-cc.c	2011-11-06 11:22:47.000000000 +0200
++++ zvbi/contrib/ntsc-cc.c	2011-11-06 11:29:04.000000000 +0200
+@@ -32,7 +32,6 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <locale.h>
+-#include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #ifdef HAVE_GETOPT_LONG
+@@ -44,6 +43,7 @@
+ #include "src/libzvbi.h"
+ 
+ #ifdef ENABLE_V4L2
++#  include <sys/ioctl.h>
+ #  include <asm/types.h>
+ #  include "src/videodev2k.h"
+ #endif
diff --git a/contrib/src/zvbi/zvbi-ssize_max.patch b/contrib/src/zvbi/zvbi-ssize_max.patch
new file mode 100644
index 0000000..eb980a6
--- /dev/null
+++ b/contrib/src/zvbi/zvbi-ssize_max.patch
@@ -0,0 +1,28 @@
+Linear memory extents over SSIZE_MAX are undefined, so there is no
+point in protecting against them.
+diff -ru zvbi.orig/src/export.c zvbi/src/export.c
+--- zvbi.orig/src/export.c	2011-11-06 11:22:47.000000000 +0200
++++ zvbi/src/export.c	2011-11-06 11:27:39.000000000 +0200
+@@ -1076,8 +1076,6 @@
+ 		size_t count;
+ 
+ 		count = src_size;
+-		if (unlikely (src_size > SSIZE_MAX))
+-			count = SSIZE_MAX & -4096;
+ 
+ 		for (retry = 10;; --retry) {
+ 			actual = write (e->_handle.fd, src, count);
+@@ -1632,12 +1630,7 @@
+ 			free (e->buffer.data);
+ 		}
+ 
+-		if (unlikely (e->buffer.offset > (size_t) SSIZE_MAX)) {
+-			errno = EOVERFLOW;
+-			actual = -1; /* failed */
+-		} else {
+-			actual = e->buffer.offset;
+-		}
++		actual = e->buffer.offset;
+ 	} else {
+ 		if (VBI_EXPORT_TARGET_ALLOC == e->target)
+ 			free (e->buffer.data);



More information about the vlc-commits mailing list