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
define Package/libv4l/Default
TITLE:=Video 4 Linux
- URL:=http://www.linuxtv.org/
+ URL:=https://www.linuxtv.org/
endef
define Package/libv4l/Default/description
--- /dev/null
+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)