Compare commits

..

3 Commits
rawhide ... f34

Author SHA1 Message Date
Michal Hlavinka 9fa98ad6d2 Merge branch 'rawhide' into f34 2021-12-01 10:29:23 +01:00
Michal Hlavinka adfc779790 Merge branch 'rawhide' into f34 2021-08-03 00:00:10 +02:00
Michal Hlavinka 0919d09f44 add opus-devel BR to satisfy configure requirements check (#1931251) 2021-02-22 11:06:13 +01:00
8 changed files with 107 additions and 131 deletions

1
.gitignore vendored
View File

@ -6,4 +6,3 @@ libsndfile-1.0.21.tar.gz
/libsndfile-1.0.27.tar.gz
/libsndfile-1.0.28.tar.gz
/libsndfile-1.0.31.tar.bz2
/libsndfile-1.1.0.tar.xz

View File

@ -1,7 +1,7 @@
diff -up libsndfile-1.1.0/CMakeLists.txt.system-gsm libsndfile-1.1.0/CMakeLists.txt
--- libsndfile-1.1.0/CMakeLists.txt.system-gsm 2022-03-27 14:39:27.000000000 +0200
+++ libsndfile-1.1.0/CMakeLists.txt 2022-04-25 22:41:46.472440316 +0200
@@ -286,7 +286,6 @@ add_library (sndfile
diff -up libsndfile-1.0.31/CMakeLists.txt.nobundlegsm libsndfile-1.0.31/CMakeLists.txt
--- libsndfile-1.0.31/CMakeLists.txt.nobundlegsm 2021-01-24 13:22:23.000000000 +0100
+++ libsndfile-1.0.31/CMakeLists.txt 2021-01-27 12:54:51.112184824 +0100
@@ -230,7 +230,6 @@ add_library (sndfile
src/double64.c
src/ima_adpcm.c
src/ms_adpcm.c
@ -9,10 +9,10 @@ diff -up libsndfile-1.1.0/CMakeLists.txt.system-gsm libsndfile-1.1.0/CMakeLists.
src/dwvw.c
src/vox_adpcm.c
src/interleave.c
@@ -347,23 +346,6 @@ add_library (sndfile
src/mpeg.c
src/mpeg_decode.c
src/mpeg_l3_encode.c
@@ -286,23 +285,6 @@ add_library (sndfile
src/ogg_opus.c
src/ogg_vcomment.c
src/nms_adpcm.c
- src/GSM610/config.h
- src/GSM610/gsm.h
- src/GSM610/gsm610_priv.h
@ -33,18 +33,18 @@ diff -up libsndfile-1.1.0/CMakeLists.txt.system-gsm libsndfile-1.1.0/CMakeLists.
src/G72x/g72x.h
src/G72x/g72x_priv.h
src/G72x/g721.c
@@ -412,6 +394,7 @@ target_link_libraries (sndfile
@@ -349,6 +331,7 @@ target_link_libraries (sndfile
$<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:FLAC::FLAC>
$<$<AND:$<BOOL:${ENABLE_EXPERIMENTAL}>,$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>,$<BOOL:${HAVE_SPEEX}>>:Speex::Speex>
$<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:Opus::opus>
$<$<BOOL:${HAVE_MPEG}>:MPG123::libmpg123>
$<$<BOOL:${HAVE_MPEG}>:Lame::Lame>
+ -lgsm
)
set_target_properties (sndfile PROPERTIES
PUBLIC_HEADER "${sndfile_HDRS}"
diff -up libsndfile-1.1.0/Makefile.am.system-gsm libsndfile-1.1.0/Makefile.am
--- libsndfile-1.1.0/Makefile.am.system-gsm 2022-03-27 10:55:12.000000000 +0200
+++ libsndfile-1.1.0/Makefile.am 2022-04-25 22:39:56.976112391 +0200
@@ -47,7 +47,6 @@ SYMBOL_FILES = src/Symbols.gnu-binutils
diff -up libsndfile-1.0.31/Makefile.am.nobundlegsm libsndfile-1.0.31/Makefile.am
--- libsndfile-1.0.31/Makefile.am.nobundlegsm 2021-01-27 12:57:08.819482207 +0100
+++ libsndfile-1.0.31/Makefile.am 2021-01-27 12:57:08.847481859 +0100
@@ -46,7 +46,6 @@ SYMBOL_FILES = src/Symbols.gnu-binutils
EXTRA_DIST += include/sndfile.h.in src/config.h.in src/test_endswap.tpl src/test_endswap.def \
$(SYMBOL_FILES) src/create_symbols_file.py src/binheader_writef_check.py \
@ -52,16 +52,16 @@ diff -up libsndfile-1.1.0/Makefile.am.system-gsm libsndfile-1.1.0/Makefile.am
src/G72x/README src/G72x/README.original src/G72x/ChangeLog \
src/make-static-lib-hidden-privates.sh \
src/config.h.cmake
@@ -72,7 +71,7 @@ src_libsndfile_la_SOURCES = src/sndfile.
src/ogg.c src/ogg.h src/ogg_vorbis.c src/ogg_speex.c src/ogg_pcm.c src/ogg_opus.c src/ogg_vcomment.c src/ogg_vcomment.h \
src/common.h src/sfconfig.h src/sfendian.h src/wavlike.h src/sf_unistd.h src/chanmap.h src/mpeg.c
@@ -71,7 +70,7 @@ src_libsndfile_la_SOURCES = src/sndfile.
src/ogg_vorbis.c src/ogg_speex.c src/ogg_pcm.c src/ogg_opus.c src/ogg_vcomment.c \
src/common.h src/sfconfig.h src/sfendian.h src/wavlike.h src/sf_unistd.h src/ogg.h src/chanmap.h src/ogg_vcomment.h
nodist_src_libsndfile_la_SOURCES = $(nodist_include_HEADERS)
-src_libsndfile_la_LIBADD = src/GSM610/libgsm.la src/G72x/libg72x.la src/ALAC/libalac.la \
+src_libsndfile_la_LIBADD = -lgsm src/G72x/libg72x.la src/ALAC/libalac.la \
src/libcommon.la $(EXTERNAL_XIPH_LIBS) -lm $(MPEG_LIBS)
src/libcommon.la $(EXTERNAL_XIPH_LIBS) -lm
EXTRA_src_libsndfile_la_DEPENDENCIES = $(SYMBOL_FILES)
@@ -91,17 +90,6 @@ src_test_main_SOURCES = src/test_main.c
@@ -90,17 +89,6 @@ src_test_main_SOURCES = src/test_main.c
src/test_binheader_writef.c src/test_nms_adpcm.c
src_test_main_LDADD = src/libcommon.la
@ -79,9 +79,9 @@ diff -up libsndfile-1.1.0/Makefile.am.system-gsm libsndfile-1.1.0/Makefile.am
############
# src/G72x #
############
diff -up libsndfile-1.1.0/src/gsm610.c.system-gsm libsndfile-1.1.0/src/gsm610.c
--- libsndfile-1.1.0/src/gsm610.c.system-gsm 2021-05-17 11:12:28.000000000 +0200
+++ libsndfile-1.1.0/src/gsm610.c 2022-04-25 22:37:21.059496852 +0200
diff -up libsndfile-1.0.31/src/gsm610.c.nobundlegsm libsndfile-1.0.31/src/gsm610.c
--- libsndfile-1.0.31/src/gsm610.c.nobundlegsm 2021-01-23 17:12:45.000000000 +0100
+++ libsndfile-1.0.31/src/gsm610.c 2021-01-27 12:54:51.112184824 +0100
@@ -27,7 +27,7 @@
#include "sfendian.h"
#include "common.h"

View File

@ -0,0 +1,25 @@
From 725c7dbb95bfaf8b4bb7b04820e3a00cceea9ce6 Mon Sep 17 00:00:00 2001
From: Erik de Castro Lopo <erikd@mega-nerd.com>
Date: Wed, 24 Dec 2014 21:02:35 +1100
Subject: [PATCH] src/file_io.c : Prevent potential divide-by-zero.
Closes: https://github.com/erikd/libsndfile/issues/92
---
src/file_io.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/file_io.c b/src/file_io.c
index 26d3d6d..6ccab78 100644
--- a/src/file_io.c
+++ b/src/file_io.c
@@ -1322,6 +1322,9 @@ psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf
{ sf_count_t total = 0 ;
ssize_t count ;
+ if (bytes == 0 || items == 0)
+ return 0 ;
+
if (psf->virtual_io)
return psf->vio.write (ptr, bytes*items, psf->vio_user_data) / bytes ;

View File

@ -0,0 +1,25 @@
From ced91d7b971be6173b604154c39279ce90ad87cc Mon Sep 17 00:00:00 2001
From: yuan <ssspeed00@gmail.com>
Date: Tue, 20 Apr 2021 16:16:32 +0800
Subject: [PATCH] flac: Fix improper buffer reusing (#732)
---
src/flac.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/flac.c b/src/flac.c
index 64d0172e6..e33204505 100644
--- a/src/flac.c
+++ b/src/flac.c
@@ -948,7 +948,11 @@ flac_read_loop (SF_PRIVATE *psf, unsigned len)
/* Decode some more. */
while (pflac->pos < pflac->len)
{ if (FLAC__stream_decoder_process_single (pflac->fsd) == 0)
+ { psf_log_printf (psf, "FLAC__stream_decoder_process_single returned false\n") ;
+ /* Current frame is busted, so NULL the pointer. */
+ pflac->frame = NULL ;
break ;
+ } ;
state = FLAC__stream_decoder_get_state (pflac->fsd) ;
if (state >= FLAC__STREAM_DECODER_END_OF_STREAM)
{ psf_log_printf (psf, "FLAC__stream_decoder_get_state returned %s\n", FLAC__StreamDecoderStateString [state]) ;

View File

@ -0,0 +1,21 @@
diff --git a/src/ms_adpcm.c b/src/ms_adpcm.c
index 5e8f1a31..a21cb994 100644
--- a/src/ms_adpcm.c
+++ b/src/ms_adpcm.c
@@ -128,8 +128,14 @@ wavlike_msadpcm_init (SF_PRIVATE *psf, int blockalign, int samplesperblock)
if (psf->file.mode == SFM_WRITE)
samplesperblock = 2 + 2 * (blockalign - 7 * psf->sf.channels) / psf->sf.channels ;
- if (blockalign < 7 * psf->sf.channels)
- { psf_log_printf (psf, "*** Error blockalign (%d) should be > %d.\n", blockalign, 7 * psf->sf.channels) ;
+ /* There's 7 samples per channel in the preamble of each block */
+ if (samplesperblock < 7 * psf->sf.channels)
+ { psf_log_printf (psf, "*** Error samplesperblock (%d) should be >= %d.\n", samplesperblock, 7 * psf->sf.channels) ;
+ return SFE_INTERNAL ;
+ } ;
+
+ if (2 * blockalign < samplesperblock * psf->sf.channels)
+ { psf_log_printf (psf, "*** Error blockalign (%d) should be >= %d.\n", blockalign, samplesperblock * psf->sf.channels / 2) ;
return SFE_INTERNAL ;
} ;

View File

@ -1,75 +0,0 @@
From cefd7b59df628eca240af3c136d66137c8e94888 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= <zmoelnig@iem.at>
Date: Thu, 8 Sep 2022 10:49:36 +0200
Subject: [PATCH] tests: Use fuzzy comparison in test-suite
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Using exact comparison ("a == b") when comparing expected with computed
test data fails the test-suite on many architectures (including, but not
limited to armhf and arm64).
Instead, use epsilon(for now, FLT_EPSILON and DBL_EPSILON) to compare
floating point numbers for equality.
Closes: https://github.com/libsndfile/libsndfile/issues/866
Signed-off-by: IOhannes m zmölnig <zmoelnig@iem.at>
---
tests/utils.tpl | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/tests/utils.tpl b/tests/utils.tpl
index c68e3a26e..0d1cd8bb9 100644
--- a/tests/utils.tpl
+++ b/tests/utils.tpl
@@ -193,6 +193,7 @@ sf_count_t file_length_fd (int fd) ;
#include <string.h>
#include <ctype.h>
#include <math.h>
+#include <float.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -215,6 +216,28 @@ sf_count_t file_length_fd (int fd) ;
#define O_BINARY 0
#endif
+
+/*
+** Compare for equality, with epsilon
+*/
+static inline int
+equals_short (const short a, const short b)
+{ return (a == b);
+} /* equals_short */
+static inline int
+equals_int (const int a, const int b)
+{ return (a == b);
+} /* equals_int */
+static inline int
+equals_float (const float a, const float b)
+{ return (fabsf(a - b) <= FLT_EPSILON);
+} /* equals_float */
+static inline int
+equals_double (const double a, const double b)
+{ return (fabs(a - b) <= DBL_EPSILON);
+} /* equals_double */
+
+
[+ FOR float_type +]
void
gen_windowed_sine_[+ (get "name") +] ([+ (get "name") +] *data, int len, double maximum)
@@ -752,8 +775,8 @@ compare_[+ (get "io_element") +]_or_die (const [+ (get "io_element") +] *expecte
unsigned k ;
for (k = 0 ; k < count ; k++)
- if (expected [k] != actual [k])
- { printf ("\n\nLine %d : Error at index %d, got " [+ (get "format_str") +] ", should be " [+ (get "format_str") +] ".\n\n", line_num, k, actual [k], expected [k]) ;
+ if (!equals_[+ (get "io_element") +](expected [k], actual [k]))
+ { printf ("\n\nLine %d : Error at index %d, got " [+ (get "format_str") +] ", should be " [+ (get "format_str") +] "(delta=" [+ (get "format_str") +] " ).\n\n", line_num, k, actual [k], expected [k], actual [k] - expected [k]) ;
exit (1) ;
} ;

View File

@ -1,13 +1,16 @@
Summary: Library for reading and writing sound files
Name: libsndfile
Version: 1.1.0
Version: 1.0.31
Release: 6%{?dist}
License: LGPLv2+ and GPLv2+ and BSD
URL: http://libsndfile.github.io/libsndfile/
Source0: https://github.com/libsndfile/libsndfile/releases/download/%{version}/libsndfile-%{version}.tar.xz
Source0: https://github.com/libsndfile/libsndfile/releases/download/%{version}/libsndfile-%{version}.tar.bz2
Patch0: libsndfile-1.0.25-system-gsm.patch
Patch1: libsndfile-1.1.0-cefd7b59.patch
BuildRequires: autogen
Patch1: libsndfile-1.0.25-zerodivfix.patch
# from upstream, fix #1984320=CVE-2021-3246, for <= 1.0.31
Patch2: libsndfile-1.0.31-deb669ee.patch
# from upstream, fix #2027692, for <= 1.0.31
Patch3: libsndfile-1.0.31-ced91d7b.patch
BuildRequires: gcc-c++
BuildRequires: alsa-lib-devel
BuildRequires: flac-devel
@ -21,8 +24,6 @@ BuildRequires: libtool
BuildRequires: make
BuildRequires: python3
BuildRequires: opus-devel
BuildRequires: lame-devel
BuildRequires: mpg123-devel
%description
@ -58,8 +59,11 @@ This package contains command line utilities for libsndfile.
%prep
%setup -q
%patch0 -p1 -b .system-gsm
%patch1 -p1 -b .cefd7b59
rm -r src/GSM610
# TODO: check if this patch is still needed
%patch1 -p1 -b .zerodivfix
%patch2 -p1 -b .deb669ee
%patch3 -p1 -b .ced91d7b
%build
autoreconf -I M4 -fiv # for system-gsm patch
@ -68,7 +72,6 @@ autoreconf -I M4 -fiv # for system-gsm patch
--enable-sqlite \
--enable-alsa \
--enable-largefile \
--enable-mpeg \
--disable-static
# Get rid of rpath
@ -117,8 +120,7 @@ LD_LIBRARY_PATH=$PWD/src/.libs make check
%files
%{!?_licensedir:%global license %%doc}
%license COPYING
# NEWS files is missing in 1.1.0, check if it was re-added
%doc AUTHORS README
%doc AUTHORS README NEWS
%{_libdir}/%{name}.so.*
%files utils
@ -153,27 +155,6 @@ LD_LIBRARY_PATH=$PWD/src/.libs make check
%changelog
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Sep 13 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.1.0-5
- Rebuilt for flac 1.4.0
* Sat Sep 10 2022 Michal Hlavinka <mhlavink@redhat.com> - 1.1.0-4
- enable MP3 support
* Wed Aug 03 2022 Michal Hlavinka <mhlavink@redhat.com> - 1.1.0-3
- new MPEG support does not compile on some archs, do not enable it yet
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Apr 25 2022 Michal Hlavinka <mhlavink@redhat.com> - 1.1.0-1
- updated to 1.1.0
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.31-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Dec 01 2021 Michal Hlavinka <mhlavink@redhat.com> - 1.0.31-6
- fix heap buffer overflow in flac (#2027692)

View File

@ -1 +1 @@
SHA512 (libsndfile-1.1.0.tar.xz) = d01696a8a88a4444e5eb91a137cf7b26b55b12c1fe3b648653f7e78674bbdf61870066216c9ff2f6a1e63bdf7b558af9a759480cf6523b607d29347b12762006
SHA512 (libsndfile-1.0.31.tar.bz2) = 62202092e5cac6346fd3c0a977380e9bf888fc59d08c9c9707dc254a8ef6ed6356da2ab0430bb970c7b06ba5bb1dafa5d7b0fe13898834c1fe4acb16f409f0e1