summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-multimedia/audiofile/audiofile_0.3.6.bb1
-rw-r--r--meta-oe/recipes-multimedia/audiofile/files/test-for-CVE-2015-7747.patch166
2 files changed, 167 insertions, 0 deletions
diff --git a/meta-oe/recipes-multimedia/audiofile/audiofile_0.3.6.bb b/meta-oe/recipes-multimedia/audiofile/audiofile_0.3.6.bb
index f734a41dfc..b14b4792b3 100644
--- a/meta-oe/recipes-multimedia/audiofile/audiofile_0.3.6.bb
+++ b/meta-oe/recipes-multimedia/audiofile/audiofile_0.3.6.bb
@@ -19,6 +19,7 @@ SRC_URI = " \
19 file://0006-Check-for-multiplication-overflow-in-sfconvert.patch \ 19 file://0006-Check-for-multiplication-overflow-in-sfconvert.patch \
20 file://0007-Actually-fail-when-error-occurs-in-parseFormat.patch \ 20 file://0007-Actually-fail-when-error-occurs-in-parseFormat.patch \
21 file://0008-Check-for-multiplication-overflow-in-MSADPCM-decodeS.patch \ 21 file://0008-Check-for-multiplication-overflow-in-MSADPCM-decodeS.patch \
22 file://test-for-CVE-2015-7747.patch \
22 file://CVE-2019-13147.patch \ 23 file://CVE-2019-13147.patch \
23 file://CVE-2022-24599.patch \ 24 file://CVE-2022-24599.patch \
24" 25"
diff --git a/meta-oe/recipes-multimedia/audiofile/files/test-for-CVE-2015-7747.patch b/meta-oe/recipes-multimedia/audiofile/files/test-for-CVE-2015-7747.patch
new file mode 100644
index 0000000000..a62cc7589b
--- /dev/null
+++ b/meta-oe/recipes-multimedia/audiofile/files/test-for-CVE-2015-7747.patch
@@ -0,0 +1,166 @@
1From 1debf51f3a89d44c0bd46e7bc45c07342087dd7c Mon Sep 17 00:00:00 2001
2From: Fabrizio Gennari <fabrizio.ge@tiscali.it>
3Date: Sun, 4 Oct 2015 01:14:00 +0200
4Subject: [PATCH 2/2] Add a test case for conversion of both sample format and
5 number of channels
6
7This patch contains the testcase backport to version 0.3.6.
8Author: Stanislav Brabec <sbrabec@suse.com>
9
10https://bugzilla.novell.com/show_bug.cgi?id=949399#c7
11
12
13This patch is from opensuse, to verify a CVE fix:
14https://build.opensuse.org/projects/multimedia:libs/packages/audiofile/files/audiofile-CVE-2015-7747.patch:
15
16Upstream-Status: Inactive-Upstream [lastcommit: 2016-Aug-30]
17Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
18---
19 test/Makefile.am | 2 +
20 test/sixteen-stereo-to-eight-mono.c | 118 ++++++++++++++++++++++++++++++++++++
21 2 files changed, 120 insertions(+)
22 create mode 100644 test/sixteen-stereo-to-eight-mono.c
23
24diff --git a/test/Makefile.am b/test/Makefile.am
25index 7bbf8e4..d311719 100644
26--- a/test/Makefile.am
27+++ b/test/Makefile.am
28@@ -27,6 +27,7 @@ TESTS = \
29 VirtualFile \
30 floatto24 \
31 query2 \
32+ sixteen-stereo-to-eight-mono \
33 sixteen-to-eight \
34 testchannelmatrix \
35 testdouble \
36@@ -143,6 +144,7 @@ printmarkers_SOURCES = printmarkers.c
37 printmarkers_LDADD = $(LIBAUDIOFILE) -lm
38
39 sixteen_to_eight_SOURCES = sixteen-to-eight.c TestUtilities.cpp TestUtilities.h
40+sixteen_stereo_to_eight_mono_SOURCES = sixteen-stereo-to-eight-mono.c TestUtilities.cpp TestUtilities.h
41
42 testchannelmatrix_SOURCES = testchannelmatrix.c TestUtilities.cpp TestUtilities.h
43
44diff --git a/test/sixteen-stereo-to-eight-mono.c b/test/sixteen-stereo-to-eight-mono.c
45new file mode 100644
46index 0000000..0f14636
47--- /dev/null
48+++ b/test/sixteen-stereo-to-eight-mono.c
49@@ -0,0 +1,117 @@
50+/*
51+ Audio File Library
52+
53+ Copyright 2000, Silicon Graphics, Inc.
54+
55+ This program is free software; you can redistribute it and/or modify
56+ it under the terms of the GNU General Public License as published by
57+ the Free Software Foundation; either version 2 of the License, or
58+ (at your option) any later version.
59+
60+ This program is distributed in the hope that it will be useful,
61+ but WITHOUT ANY WARRANTY; without even the implied warranty of
62+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
63+ GNU General Public License for more details.
64+
65+ You should have received a copy of the GNU General Public License along
66+ with this program; if not, write to the Free Software Foundation, Inc.,
67+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
68+*/
69+
70+/*
71+ sixteen-stereo-to-eight-mono.c
72+
73+ This program tests the conversion from 2-channel 16-bit integers to
74+ 1-channel 8-bit integers.
75+*/
76+
77+#ifdef HAVE_CONFIG_H
78+#include <config.h>
79+#endif
80+
81+#include <stdint.h>
82+#include <stdio.h>
83+#include <stdlib.h>
84+#include <string.h>
85+#include <unistd.h>
86+#include <limits.h>
87+
88+#include <audiofile.h>
89+
90+#include "TestUtilities.h"
91+
92+int main (int argc, char **argv)
93+{
94+ AFfilehandle file;
95+ AFfilesetup setup;
96+ int16_t frames16[] = {14298, 392, 3923, -683, 958, -1921};
97+ int8_t frames8[] = {28, 6, -2};
98+ int i, frameCount = 3;
99+ int8_t byte;
100+ AFframecount result;
101+
102+ setup = afNewFileSetup();
103+
104+ afInitFileFormat(setup, AF_FILE_WAVE);
105+
106+ afInitSampleFormat(setup, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, 16);
107+ afInitChannels(setup, AF_DEFAULT_TRACK, 2);
108+
109+ char testFileName[PATH_MAX];
110+ if (!createTemporaryFile("sixteen-to-eight", testFileName))
111+ {
112+ fprintf(stderr, "Could not create temporary file.\n");
113+ exit(EXIT_FAILURE);
114+ }
115+
116+ file = afOpenFile(testFileName, "w", setup);
117+ if (file == AF_NULL_FILEHANDLE)
118+ {
119+ fprintf(stderr, "could not open file for writing\n");
120+ exit(EXIT_FAILURE);
121+ }
122+
123+ afFreeFileSetup(setup);
124+
125+ afWriteFrames(file, AF_DEFAULT_TRACK, frames16, frameCount);
126+
127+ afCloseFile(file);
128+
129+ file = afOpenFile(testFileName, "r", AF_NULL_FILESETUP);
130+ if (file == AF_NULL_FILEHANDLE)
131+ {
132+ fprintf(stderr, "could not open file for reading\n");
133+ exit(EXIT_FAILURE);
134+ }
135+
136+ afSetVirtualSampleFormat(file, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, 8);
137+ afSetVirtualChannels(file, AF_DEFAULT_TRACK, 1);
138+
139+ for (i=0; i<frameCount; i++)
140+ {
141+ /* Read one frame. */
142+ result = afReadFrames(file, AF_DEFAULT_TRACK, &byte, 1);
143+
144+ if (result != 1)
145+ break;
146+
147+ /* Compare the byte read with its precalculated value. */
148+ if (memcmp(&byte, &frames8[i], 1) != 0)
149+ {
150+ printf("error\n");
151+ printf("expected %d, got %d\n", frames8[i], byte);
152+ exit(EXIT_FAILURE);
153+ }
154+ else
155+ {
156+#ifdef DEBUG
157+ printf("got what was expected: %d\n", byte);
158+#endif
159+ }
160+ }
161+
162+ afCloseFile(file);
163+ unlink(testFileName);
164+
165+ exit(EXIT_SUCCESS);
166+}