v4l-utils: Update to 1.16.5 8542/head
authorRosen Penev <rosenp@gmail.com>
Thu, 28 Mar 2019 07:21:58 +0000 (00:21 -0700)
committerRosen Penev <rosenp@gmail.com>
Sat, 30 Mar 2019 08:18:43 +0000 (01:18 -0700)
Add Alpine Linux patch that fixes a crash under Musl.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/libv4l/Makefile
libs/libv4l/patches/010-remove-libudev-check.patch
libs/libv4l/patches/030-getsubopt.patch [new file with mode: 0644]

index b034e3638eeff8b6be0517af72c23122e9a8eca1..23b891a3dfc5317d7f93e2a430cb13bd1d331027 100644 (file)
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=v4l-utils
-PKG_VERSION:=1.16.3
+PKG_VERSION:=1.16.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://www.linuxtv.org/downloads/v4l-utils
-PKG_HASH:=7c5c0d49c130cf65d384f28e9f3a53c5f7d17bf18740c48c40810e0fbbed5b54
+PKG_HASH:=ed80242510385017a1dc566e17a285a77222bb301f5bc19386badfcc2c19df1b
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=GPL-2.0 LGPL-2.1
@@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/nls.mk
 
 define Package/libv4l/Default
   TITLE:=Video 4 Linux
-  URL:=http://www.linuxtv.org/
+  URL:=https://www.linuxtv.org/
 endef
 
 define Package/libv4l/Default/description
index 6a9784adb06f015c7e0515de80b7ea167c2dda2d..2e55aa288352352a5e1f50293966024999bec777 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -283,16 +283,9 @@ else
+@@ -309,16 +309,9 @@ else
     AC_MSG_WARN(ALSA library not available)
  fi
  
diff --git a/libs/libv4l/patches/030-getsubopt.patch b/libs/libv4l/patches/030-getsubopt.patch
new file mode 100644 (file)
index 0000000..c476e5e
--- /dev/null
@@ -0,0 +1,36 @@
+POSIX says that behavior when subopts list is empty is undefined.
+musl libs will set value to NULL which leads to crash.
+
+Simply avoid getsubopt, since we cannot rely on it.
+
+diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
+index 3ea6cd3..291fb3e 100644
+--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
++++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
+@@ -692,16 +692,17 @@ static bool parse_subset(char *optarg)
+ static bool parse_next_subopt(char **subs, char **value)
+ {
+-      static char *const subopts[] = {
+-          NULL
+-      };
+-      int opt = getsubopt(subs, subopts, value);
++      char *p = *subs;
++      *value = *subs;
+-      if (opt < 0 || *value)
+-              return false;
+-      fprintf(stderr, "No value given to suboption <%s>\n",
+-                      subopts[opt]);
+-      return true;
++      while (*p && *p != ',')
++              p++;
++
++      if (*p)
++              *p++ = '\0';
++
++      *subs = p;
++      return false;
+ }
+ void common_cmd(int ch, char *optarg)