]> git.pld-linux.org Git - packages/xevd.git/commitdiff
- added comparison fix from git auto/th/xevd-0.4.1-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 14 Apr 2024 10:51:37 +0000 (12:51 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 14 Apr 2024 10:51:37 +0000 (12:51 +0200)
xevd-comparison.patch [new file with mode: 0644]
xevd.spec

diff --git a/xevd-comparison.patch b/xevd-comparison.patch
new file mode 100644 (file)
index 0000000..4561426
--- /dev/null
@@ -0,0 +1,39 @@
+From e4ae0c567a6ec5e10c9f5ed44c61e4e3b6816c16 Mon Sep 17 00:00:00 2001
+From: Neal Gompa <neal@gompa.dev>
+Date: Wed, 18 Oct 2023 08:31:03 -0400
+Subject: [PATCH] app: Fix invalid comparison of c_buf in write_y4m_header
+
+This fixes the following error:
+
+/builddir/build/BUILD/xevd-0.4.1/app/xevd_app.c: In function 'write_y4m_header':
+/builddir/build/BUILD/xevd-0.4.1/app/xevd_app.c:300:15: error: the comparison will always evaluate as 'false' for the address of 'c_buf' will never be NULL [-Werror=address]
+  300 |     if (c_buf == NULL)
+      |               ^~
+---
+ app/xevd_app.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/app/xevd_app.c b/app/xevd_app.c
+index abc1f17..ed1fbcd 100644
+--- a/app/xevd_app.c
++++ b/app/xevd_app.c
+@@ -273,8 +273,8 @@ static int write_y4m_header(char * fname, XEVD_IMGB * img)
+     int bit_depth  =   op_out_bit_depth;
+     int len = 80;
+     int buff_len = 0;
+-    char buf[80] = { 0, };
+-    char c_buf[16] = { 0, };
++    char buf[80] = { '\0', };
++    char c_buf[16] = { '\0', };
+     FILE          * fp;
+     if (color_format == XEVD_CF_YCBCR420)
+@@ -297,7 +297,7 @@ static int write_y4m_header(char * fname, XEVD_IMGB * img)
+         if (bit_depth == 8)  strcpy(c_buf, "mono");
+     }
+-    if (c_buf == NULL)
++    if (strlen(c_buf) == 0)
+     {
+         logv0("Color format is not suuported by y4m");
+         return XEVD_ERR;
index 1fe7c668995415119e339007872775c646f92155..c0da41a98ab58055be4e2adfc7951ddc0628bc46 100644 (file)
--- a/xevd.spec
+++ b/xevd.spec
@@ -16,6 +16,7 @@ Source0:      https://github.com/mpeg5/xevd/archive/v%{gitref}/%{name}-%{gitref}.tar.
 Patch0:                %{name}-string.patch
 Patch1:                %{name}-link.patch
 Patch2:                %{name}-dangling-pointer.patch
+Patch3:                %{name}-comparison.patch
 URL:           https://github.com/mpeg5/xevd
 BuildRequires: cmake >= 3.5
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -130,6 +131,7 @@ Statyczna biblioteka XEVD (profil Baseline).
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 echo "v%{version}" > version.txt
 
This page took 0.108846 seconds and 4 git commands to generate.