public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gpac] f45: backport upstream patch to unbreak external code using string functions
@ 2026-08-25 13:05 Dominik 'Rathann' Mierzejewski
  0 siblings, 0 replies; only message in thread
From: Dominik 'Rathann' Mierzejewski @ 2026-08-25 13:05 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/gpac
Branch : f45
Commit : d578b292dab7b3934a46df14abab74b73477fe40
Author : Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
Date   : 2026-08-25T13:48:26+02:00
Stats  : +93/-5 in 4 file(s)
URL    : https://src.fedoraproject.org/rpms/gpac/c/d578b292dab7b3934a46df14abab74b73477fe40?branch=f45

Log:
backport upstream patch to unbreak external code using string functions

---
diff --git a/gpac-strcpy.patch b/gpac-strcpy.patch
index 2ca353a..ca4f23c 100644
--- a/gpac-strcpy.patch
+++ b/gpac-strcpy.patch
@@ -5,7 +5,7 @@ diff -up gpac-26.07.0/applications/generators/MPEG4/main.c.orig gpac-26.07.0/app
  #undef _DEBUG
  #undef DEBUG
  
-+#define GPAC_ALLOW_UNSAFE_STRFUNC
++#undef GPAC_DISABLE_UNSAFE_STRFUNC
  #include <gpac/list.h>
  
  
@@ -16,7 +16,7 @@ diff -up gpac-26.07.0/applications/generators/X3D/main.c.orig gpac-26.07.0/appli
  #include <stdio.h>
  #include <string.h>
  
-+#define GPAC_ALLOW_UNSAFE_STRFUNC
++#undef GPAC_DISABLE_UNSAFE_STRFUNC
  #include <gpac/list.h>
  #include <time.h>
  

diff --git a/gpac-string-functions.patch b/gpac-string-functions.patch
new file mode 100644
index 0000000..74c31d6
--- /dev/null
+++ b/gpac-string-functions.patch
@@ -0,0 +1,82 @@
+From 239c20cdfe9dad19580e87f98ca0fd8b55fe560b Mon Sep 17 00:00:00 2001
+From: Aurelien David <aurelien.david@telecom-paris.fr>
+Date: Tue, 25 Aug 2026 11:44:29 +0200
+Subject: [PATCH] change GPAC_ALLOW_UNSAFE_STRFUNC to
+ GPAC_DISABLE_UNSAFE_STRFUNC enabled for gpac only to prevent error in client
+ code (#3880)
+
+---
+ configure                           |  3 +++
+ include/gpac/setup.h                | 13 +++++++------
+ modules/dektec_out/dektec_video.cpp |  4 ++--
+ 3 files changed, 12 insertions(+), 8 deletions(-)
+
+diff --git a/configure b/configure
+index a9c7af3e3c..945ff06626 100755
+--- a/configure
++++ b/configure
+@@ -1216,6 +1216,9 @@ if test "$want_gcov"  = "yes" ; then
+     LDFLAGS="$LDFLAGS --coverage"
+ fi
+ 
++# disable unsafe str functions for gpac
++CFLAGS="$CFLAGS -DGPAC_DISABLE_UNSAFE_STRFUNC"
++
+ #force use of cflags with cc
+ cc_naked=$cc
+ cxx_naked=$cxx
+diff --git a/include/gpac/setup.h b/include/gpac/setup.h
+index d5d3237ba9..427f3d5200 100644
+--- a/include/gpac/setup.h
++++ b/include/gpac/setup.h
+@@ -872,21 +872,22 @@ size_t gf_strlcat(char *dst, const char *src, size_t dsize);
+ /*! safe gf_strcat macro calling gf_strlcat */
+ #define gf_strcat(_dst, _src) gf_strlcat(_dst, _src, sizeof(_dst) / sizeof(_dst[0]) )
+ 
++
+ /*! by default always disable unsafe str functions*/
+-#ifndef GPAC_ALLOW_UNSAFE_STRFUNC
++#ifdef GPAC_DISABLE_UNSAFE_STRFUNC
+ #undef strcpy
+-#define strcpy #error "strcpy forbidden in libgpac - use gf_strcpy, gf_strlcpy or memcpy or define GPAC_ALLOW_UNSAFE_STRFUNC before including GPAC headers"
++#define strcpy #error "strcpy forbidden in libgpac - use gf_strcpy, gf_strlcpy or memcpy or undef GPAC_DISABLE_UNSAFE_STRFUNC before including GPAC headers"
+ 
+ #undef strcat
+-#define strcat #error "strcat forbidden in libgpac - use gf_strlcat, gf_strcat or memcpy or define GPAC_ALLOW_UNSAFE_STRFUNC before including GPAC headers"
++#define strcat #error "strcat forbidden in libgpac - use gf_strlcat, gf_strcat or memcpy or undef GPAC_DISABLE_UNSAFE_STRFUNC before including GPAC headers"
+ 
+ #undef strncpy
+-#define strncpy #error "strncpy forbidden in libgpac - use gf_strlcpy, gf_strcpy or memcpy or define GPAC_ALLOW_UNSAFE_STRFUNC before including GPAC headers"
++#define strncpy #error "strncpy forbidden in libgpac - use gf_strlcpy, gf_strcpy or memcpy or undef GPAC_DISABLE_UNSAFE_STRFUNC before including GPAC headers"
+ 
+ #undef strncat
+-#define strncat #error "strncat forbidden in libgpac - use gf_strlcat, gf_strcat or memcpy or define GPAC_ALLOW_UNSAFE_STRFUNC before including GPAC headers"
++#define strncat #error "strncat forbidden in libgpac - use gf_strlcat, gf_strcat or memcpy or undef GPAC_DISABLE_UNSAFE_STRFUNC before including GPAC headers"
+ 
+-#endif //GPAC_ALLOW_UNSAFE_STRFUNC
++#endif //GPAC_DISABLE_UNSAFE_STRFUNC
+ 
+ #ifdef GPAC_ASSERT_FATAL
+ /*! fatal error assert, will always kill the program if condition is false
+diff --git a/modules/dektec_out/dektec_video.cpp b/modules/dektec_out/dektec_video.cpp
+index 1d011f2386..1993ff93c3 100644
+--- a/modules/dektec_out/dektec_video.cpp
++++ b/modules/dektec_out/dektec_video.cpp
+@@ -24,7 +24,7 @@
+ *
+ */
+ 
+-#define GPAC_ALLOW_UNSAFE_STRFUNC
++#undef GPAC_DISABLE_UNSAFE_STRFUNC
+ #include "dektec_video.h"
+ 
+ #ifdef GPAC_HAS_DTAPI
+@@ -52,7 +52,7 @@ static void OnNewFrameVideo(DtMxData *pData, const DtCbkCtx  *cbck)
+ 	const DtMxRowData&  OurRow = pData->m_Rows[0];
+ 	GF_DTOutCtx *ctx = cbck->ctx;
+ 	GF_FilterPacket *pck;
+-	
++
+ 	if (!ctx->is_configured || ctx->is_eos) return;
+ 	if (pData->m_NumSkippedFrames > 0) {
+ 		GF_LOG(GF_LOG_INFO, GF_LOG_MMIO, ("[DekTecOut] [%lld] #skipped frames=%d\n", pData->m_Frame, pData->m_NumSkippedFrames));

diff --git a/gpac-svggen.patch b/gpac-svggen.patch
index 31636ea..8140d3a 100644
--- a/gpac-svggen.patch
+++ b/gpac-svggen.patch
@@ -5,7 +5,7 @@ diff -up gpac-26.07.0/applications/generators/SVG/main.c.orig gpac-26.07.0/appli
   *
   */
 
-+#define GPAC_ALLOW_UNSAFE_STRFUNC
++#undef GPAC_DISABLE_UNSAFE_STRFUNC
  #include "svggen.h"
 
  SVGGenAttribute *NewSVGGenAttribute()
@@ -54,7 +54,7 @@ diff -up gpac-26.07.0/applications/generators/SVG/v3.c.orig gpac-26.07.0/applica
   *
   */
  
-+#define GPAC_ALLOW_UNSAFE_STRFUNC
++#undef GPAC_DISABLE_UNSAFE_STRFUNC
  #include "svggen.h"
  
  

diff --git a/gpac.spec b/gpac.spec
index 5860475..0162a5c 100644
--- a/gpac.spec
+++ b/gpac.spec
@@ -3,7 +3,7 @@
 Name:        gpac
 Summary:     MPEG-4 multimedia framework
 Version:     26.07.0
-Release:     2%{?dist}
+Release:     3%{?dist}
 License:     LGPL-2.0-or-later
 URL:         https://gpac.io/
 Source0:     https://github.com/gpac/gpac/archive/v%{version}/gpac-%{version}.tar.gz
@@ -18,6 +18,9 @@ Patch2:      gpac-strcpy.patch
 Patch3:      gpac-svggen.patch
 # fix building with FFmpeg 9
 Patch4:      https://github.com/gpac/gpac/pull/3853.patch#/gpac-ffmpeg9.patch
+# unbreak external users of string functions
+# https://github.com/gpac/gpac/issues/3880
+Patch5:      https://github.com/gpac/gpac/commit/239c20cdfe9dad19580e87f98ca0fd8b55fe560b.patch#/gpac-string-functions.patch
 
 BuildRequires:  SDL2-devel
 BuildRequires:  a52dec-devel
@@ -201,6 +204,9 @@ rm %{buildroot}%{_includedir}/gpac/00_doxy.h
 
 
 %changelog
+* Tue Aug 25 2026 Dominik Mierzejewski <dominik@greysector.net> - 26.07.0-3
+- backport upstream patch to unbreak external code using string functions
+
 * Tue Aug 18 2026 Dominik Mierzejewski <dominik@greysector.net> - 26.07.0-2
 - fix building with FFmpeg 9
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-25 13:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-25 13:05 [rpms/gpac] f45: backport upstream patch to unbreak external code using string functions Dominik 'Rathann' Mierzejewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox