Compare commits

...

No commits in common. 'c8' and 'c9' have entirely different histories.
c8 ... c9

@ -0,0 +1,177 @@
diff --git a/src/audio_out.c b/src/audio_out.c
index bd8f6fc..f5942d6 100644
--- a/src/audio_out.c
+++ b/src/audio_out.c
@@ -634,6 +634,10 @@ static char *_sanitize_matrix(int maxchannels, char *matrix, ao_device *device){
char *ret = calloc(strlen(matrix)+1,1); /* can only get smaller */
char *p=matrix;
int count=0;
+
+ if(!ret)
+ return NULL;
+
while(count<maxchannels){
char *h,*t;
int m=0;
@@ -706,6 +710,15 @@ static int _find_channel(int needle, char *haystack){
return -1;
}
+static void _free_map(char **m){
+ char **in=m;
+ while(m && *m){
+ free(*m);
+ m++;
+ }
+ if(in)free(in);
+}
+
static char **_tokenize_matrix(char *matrix){
char **ret=NULL;
char *p=matrix;
@@ -730,6 +743,8 @@ static char **_tokenize_matrix(char *matrix){
}
ret = calloc(count+1,sizeof(*ret));
+ if(!ret)
+ return NULL;
p=matrix;
count=0;
@@ -748,6 +763,10 @@ static char **_tokenize_matrix(char *matrix){
while(t>p && isspace(*(t-1)))t--;
ret[count] = calloc(t-p+1,1);
+ if(!ret[count]){
+ _free_map(ret);
+ return NULL;
+ }
memcpy(ret[count],p,t-p);
count++;
if(!*h)break;
@@ -755,16 +774,6 @@ static char **_tokenize_matrix(char *matrix){
}
return ret;
-
-}
-
-static void _free_map(char **m){
- char **in=m;
- while(m && *m){
- free(*m);
- m++;
- }
- if(in)free(in);
}
static unsigned int _matrix_to_channelmask(int ch, char *matrix, char *premap, int **mout){
@@ -772,7 +781,14 @@ static unsigned int _matrix_to_channelmask(int ch, char *matrix, char *premap, i
char *p=matrix;
int *perm=(*mout=malloc(ch*sizeof(*mout)));
int i;
- char **map = _tokenize_matrix(premap);
+ char **map;
+
+ if(!perm)
+ return 0;
+
+ map = _tokenize_matrix(premap);
+ if(!map)
+ return 0;
for(i=0;i<ch;i++) perm[i] = -1;
i=0;
@@ -810,6 +826,9 @@ static char *_channelmask_to_matrix(unsigned int mask, char *premap){
char buffer[257]={0};
char **map = _tokenize_matrix(premap);
+ if(!map)
+ return NULL;
+
while(map[m]){
if(mask & (1<<m)){
if(count)
@@ -849,6 +868,9 @@ static char *_matrix_intersect(char *matrix,char *premap){
int count=0;
char **map = _tokenize_matrix(premap);
+ if(!map)
+ return NULL;
+
while(1){
char *h=p;
int m=0;
@@ -1039,7 +1061,7 @@ static ao_device* _open_device(int driver_id, ao_sample_format *format,
device->output_matrix,
&device->input_map);
int channels = _channelmask_bits(mask);
- if(channels<0){
+ if(channels<=0){
aerror("Unable to map any channels from input matrix to output");
errno = AO_EBADFORMAT;
goto error;
@@ -1060,7 +1082,7 @@ static ao_device* _open_device(int driver_id, ao_sample_format *format,
device->output_matrix,
&device->input_map);
int channels = _channelmask_bits(mask);
- if(channels<0){
+ if(channels<=0){
aerror("Unable to map any channels from input matrix to output");
errno = AO_EBADFORMAT;
goto error;
@@ -1111,6 +1133,10 @@ static ao_device* _open_device(int driver_id, ao_sample_format *format,
int count=0;
device->inter_permute = calloc(device->output_channels,sizeof(int));
+ if (!device->inter_permute) {
+ errno = AO_EFAIL;
+ goto error;
+ }
adebug("\n");
while(count<device->output_channels){
@@ -1157,8 +1183,10 @@ static ao_device* _open_device(int driver_id, ao_sample_format *format,
for(i=0;i<device->output_channels;i++)
if(device->inter_permute[i]==j)break;
if(i==device->output_channels){
- adebug("input %d (%s)\t -> none\n",
- j,inch[j]);
+ if(inch){
+ adebug("input %d (%s)\t -> none\n",
+ j,inch[j]);
+ }
unflag=1;
}
}
diff --git a/src/plugins/macosx/ao_macosx.c b/src/plugins/macosx/ao_macosx.c
index a3daf1b..129020d 100644
--- a/src/plugins/macosx/ao_macosx.c
+++ b/src/plugins/macosx/ao_macosx.c
@@ -594,11 +594,11 @@ int ao_plugin_open(ao_device *device, ao_sample_format *format)
internal->firstValidByteOffset = 0;
internal->validByteCount = 0;
internal->buffer = malloc(internal->bufferByteCount);
- memset(internal->buffer, 0, internal->bufferByteCount);
if (!internal->buffer) {
aerror("Unable to allocate queue buffer.\n");
return 0;
}
+ memset(internal->buffer, 0, internal->bufferByteCount);
/* limited to stereo for now */
//if(!device->output_matrix)
diff --git a/src/plugins/sndio/ao_sndio.c b/src/plugins/sndio/ao_sndio.c
index ec251fb..e23fd47 100644
--- a/src/plugins/sndio/ao_sndio.c
+++ b/src/plugins/sndio/ao_sndio.c
@@ -67,6 +67,9 @@ int ao_plugin_device_init(ao_device *device)
{
ao_sndio_internal *internal;
internal = (ao_sndio_internal *) calloc(1,sizeof(*internal));
+ if (internal == NULL)
+ return 0;
+
internal->id=-1;
device->internal = internal;
device->output_matrix_order = AO_OUTPUT_MATRIX_FIXED;

@ -0,0 +1,18 @@
commit 1f998f5d6d77674dad01b181811638578ad68242
Author: Tristan Matthews <tmatth@videolan.org>
Date: Sun Jan 15 12:15:07 2017 -0500
pulse: fix missing include warning for nanosleep
diff --git a/src/plugins/pulse/ao_pulse.c b/src/plugins/pulse/ao_pulse.c
index 9835273b53c35bf9..2d10d57f17f6bdd6 100644
--- a/src/plugins/pulse/ao_pulse.c
+++ b/src/plugins/pulse/ao_pulse.c
@@ -30,6 +30,7 @@
#include <assert.h>
#include <string.h>
#include <signal.h>
+#include <time.h>
#include <limits.h>
#include <pulse/pulseaudio.h>

@ -1,23 +1,27 @@
Name: libao
Version: 1.2.0
Release: 10%{?dist}
Release: 22%{?dist}
Summary: Cross Platform Audio Output Library
Group: System Environment/Libraries
License: GPLv2+
URL: http://xiph.org/ao/
Source0: http://downloads.xiph.org/releases/ao/%{name}-%{version}.tar.gz
Patch1: 0001-ao_pulse.c-fix-latency-calculation.patch
# https://gitlab.xiph.org/xiph/libao/commit/d5221655dfd1a2156aa6be83b5aadea7c1e0f5bd.diff
# CVE 2017-11548
Patch2: d5221655dfd1a2156aa6be83b5aadea7c1e0f5bd.diff
Patch3: libao-nanosleep.patch
BuildRequires: gcc
BuildRequires: alsa-lib-devel
BuildRequires: pkgconfig(libpulse)
BuildRequires: make
%description
Libao is a cross platform audio output library. It currently supports
ESD, OSS, Solaris, and IRIX.
Libao is a cross-platform audio library that allows programs to output audio
using a simple API on a wide variety of platforms.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
@ -28,6 +32,8 @@ developing applications that use %{name}.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
sed -i "s/-O20 -ffast-math//" configure
@ -45,9 +51,7 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}*
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%ldconfig_scriptlets
%files
@ -66,6 +70,44 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}*
%changelog
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.2.0-22
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.2.0-21
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-19
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Sep 9 2019 Florian Weimer <fweimer@redhat.com> - 1.2.0-16
- Fix building in C99 mode
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jul 31 2018 Adam Jackson <ajax@redhat.com> - 1.2.0-13
- Backport fix for CVE 2017-11548
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Apr 06 2018 Adam Jackson <ajax@redhat.com> - 1.2.0-11
- Update description
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

Loading…
Cancel
Save