etc: Enable a tty for a serial port by default.
[dragora.git] / patches / audiofile / 09_Actually-fail-when-error-occurs-in-parseFormat.patch
blob50cd3dc9a35c7655310a72015b924516aac71a2d
1 From: Antonio Larrosa <larrosa@kde.org>
2 Date: Mon, 6 Mar 2017 18:59:26 +0100
3 Subject: Actually fail when error occurs in parseFormat
5 When there's an unsupported number of bits per sample or an invalid
6 number of samples per block, don't only print an error message using
7 the error handler, but actually stop parsing the file.
9 This fixes #35 (also reported at
10 https://bugzilla.opensuse.org/show_bug.cgi?id=1026983 and
11 https://blogs.gentoo.org/ago/2017/02/20/audiofile-heap-based-buffer-overflow-in-imadecodeblockwave-ima-cpp/
13 ---
14 libaudiofile/WAVE.cpp | 2 ++
15 1 file changed, 2 insertions(+)
17 diff --git a/libaudiofile/WAVE.cpp b/libaudiofile/WAVE.cpp
18 index 0fc48e8..d04b796 100644
19 --- a/libaudiofile/WAVE.cpp
20 +++ b/libaudiofile/WAVE.cpp
21 @@ -332,6 +332,7 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size)
23 _af_error(AF_BAD_NOT_IMPLEMENTED,
24 "IMA ADPCM compression supports only 4 bits per sample");
25 + return AF_FAIL;
28 int bytesPerBlock = (samplesPerBlock + 14) / 8 * 4 * channelCount;
29 @@ -339,6 +340,7 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size)
31 _af_error(AF_BAD_CODEC_CONFIG,
32 "Invalid samples per block for IMA ADPCM compression");
33 + return AF_FAIL;
36 track->f.sampleWidth = 16;