All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: buildroot@buildroot.org
Cc: Marcus Folkesson <marcus.folkesson@gmail.com>
Subject: [Buildroot] [PATCH] package/libcamera-apps: fix overflow conversion error
Date: Tue, 31 Jan 2023 14:36:26 +0100	[thread overview]
Message-ID: <20230131133626.638374-1-marcus.folkesson@gmail.com> (raw)

Upstream commit:
https://github.com/raspberrypi/libcamera-apps/commit/a65682a97e19f96b86aeceb3ca3befb1687e3861

Fixes:
- http://autobuild.buildroot.net/results/758631a9fcd62835844f78914a36dfb579e7beba/

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 ...ass-VIDIOC_QUERYCAP-as-unsigned-long.patch | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 package/libcamera-apps/0001-core-pass-VIDIOC_QUERYCAP-as-unsigned-long.patch

diff --git a/package/libcamera-apps/0001-core-pass-VIDIOC_QUERYCAP-as-unsigned-long.patch b/package/libcamera-apps/0001-core-pass-VIDIOC_QUERYCAP-as-unsigned-long.patch
new file mode 100644
index 0000000000..2f4b6424a1
--- /dev/null
+++ b/package/libcamera-apps/0001-core-pass-VIDIOC_QUERYCAP-as-unsigned-long.patch
@@ -0,0 +1,34 @@
+From a65682a97e19f96b86aeceb3ca3befb1687e3861 Mon Sep 17 00:00:00 2001
+From: Marcus Folkesson <marcus.folkesson@gmail.com>
+Date: Tue, 31 Jan 2023 09:14:15 +0100
+Subject: [PATCH] core: pass VIDIOC_QUERYCAP as unsigned long
+
+VIDIOC_QUARYCAP is an unsigned long and should be passed as one.
+
+Get rid of the following error:
+core/libcamera_app.cpp:33:22: error: overflow in conversion from 'long unsigned int' to 'int' changes value from '2154321408' to '-2140645888' [-Werror=overflow]
+   33 |  int ret = ioctl(fd, VIDIOC_QUERYCAP, &caps);
+
+Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
+---
+ core/libcamera_app.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/core/libcamera_app.cpp b/core/libcamera_app.cpp
+index 04696fb..8cb6563 100644
+--- a/core/libcamera_app.cpp
++++ b/core/libcamera_app.cpp
+@@ -30,7 +30,9 @@ static void check_camera_stack()
+ 		return;
+ 
+ 	v4l2_capability caps;
+-	int ret = ioctl(fd, VIDIOC_QUERYCAP, &caps);
++	unsigned long request = VIDIOC_QUERYCAP;
++
++	int ret = ioctl(fd, request, &caps);
+ 	close(fd);
+ 
+ 	if (ret < 0 || strcmp((char *)caps.driver, "bm2835 mmal"))
+-- 
+2.38.1
+
-- 
2.38.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

             reply	other threads:[~2023-01-31 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 13:36 Marcus Folkesson [this message]
2023-02-06  9:46 ` [Buildroot] [PATCH] package/libcamera-apps: fix overflow conversion error Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230131133626.638374-1-marcus.folkesson@gmail.com \
    --to=marcus.folkesson@gmail.com \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.