• 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/0003-Always-check-the-number-of-coefficients.patch
Peter KorsgaardPeter Korsgaard committed cc00bde57fc30 Mar 2017
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
From c48e4c6503f7dabd41f11d4c9c7b7f8960e7f2c0 Mon Sep 17 00:00:00 2001
2
From: Antonio Larrosa <larrosa@kde.org>
3
Date: Mon, 6 Mar 2017 12:51:22 +0100
4
Subject: [PATCH] Always check the number of coefficients
5
​
6
When building the library with NDEBUG, asserts are eliminated
7
so it's better to always check that the number of coefficients
8
is inside the array range.
9
​
10
This fixes the 00191-audiofile-indexoob issue in #41
11
​
12
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
13
---
14
 libaudiofile/WAVE.cpp | 6 ++++++
15
 1 file changed, 6 insertions(+)
16
​
17
diff --git a/libaudiofile/WAVE.cpp b/libaudiofile/WAVE.cpp
18
index 0e81cf7..61f9541 100644
19
--- a/libaudiofile/WAVE.cpp
20
+++ b/libaudiofile/WAVE.cpp
21
@@ -281,6 +281,12 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size)
22
 
23
            /* numCoefficients should be at least 7. */
24
            assert(numCoefficients >= 7 && numCoefficients <= 255);
25
+           if (numCoefficients < 7 || numCoefficients > 255)
26
+           {
27
+               _af_error(AF_BAD_HEADER,
28
+                       "Bad number of coefficients");
29
+               return AF_FAIL;
30
+           }
31
 
32
            m_msadpcmNumCoefficients = numCoefficients;
33
 
34
-- 
35
2.11.0
36
​
  • 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.