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
--- /dev/null
+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
--- /dev/null
+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);