• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/audiofile/0006-Actually-fail-when-error-occurs-in-parseFormat.patch
Peter KorsgaardPeter Korsgaard committed bd5f84d301c30 Mar 2017
Raw file
Source viewDiff to previous
 
1
From a2e9eab8ea87c4ffc494d839ebb4ea145eb9f2e6 Mon Sep 17 00:00:00 2001
2
From: Antonio Larrosa <larrosa@kde.org>
3
Date: Mon, 6 Mar 2017 18:59:26 +0100
4
Subject: [PATCH] Actually fail when error occurs in parseFormat
5
​
6
When there's an unsupported number of bits per sample or an invalid
7
number of samples per block, don't only print an error message using
8
the error handler, but actually stop parsing the file.
9
​
10
This fixes #35 (also reported at
11
https://bugzilla.opensuse.org/show_bug.cgi?id=1026983 and
12
https://blogs.gentoo.org/ago/2017/02/20/audiofile-heap-based-buffer-overflow-in-imadecodeblockwave-ima-cpp/
13
)
14
​
15
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
16
---
17
 libaudiofile/WAVE.cpp | 2 ++
18
 1 file changed, 2 insertions(+)
19
​
20
diff --git a/libaudiofile/WAVE.cpp b/libaudiofile/WAVE.cpp
21
index 0e81cf7..d762249 100644
22
--- a/libaudiofile/WAVE.cpp
23
+++ b/libaudiofile/WAVE.cpp
24
@@ -326,6 +326,7 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size)
25
            {
26
                _af_error(AF_BAD_NOT_IMPLEMENTED,
27
                    "IMA ADPCM compression supports only 4 bits per sample");
28
+               return AF_FAIL;
29
            }
30
 
31
            int bytesPerBlock = (samplesPerBlock + 14) / 8 * 4 * channelCount;
32
@@ -333,6 +334,7 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size)
33
            {
34
                _af_error(AF_BAD_CODEC_CONFIG,
35
                    "Invalid samples per block for IMA ADPCM compression");
36
+               return AF_FAIL;
37
            }
38
 
39
            track->f.sampleWidth = 16;
40
-- 
41
2.11.0
42
​
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.