summaryrefslogtreecommitdiffstats
path: root/package/libvorbis/0001-CVE-2017-14160-fix-bounds-check-on-very-low-sample-rates.patch
blob: e84f3d4799e6d83e1f6d87351b8e002313ebeaec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Thomas Daede <daede003@umn.edu>
Date: Wed, 9 May 2018 21:56:59 +0000 (-0700)
Subject: CVE-2017-14160: fix bounds check on very low sample rates.
X-Git-Url: https://git.xiph.org/?p=vorbis.git;a=commitdiff_plain;h=018ca26dece618457dd13585cad52941193c4a25

CVE-2017-14160: fix bounds check on very low sample rates.

Downloaded from upstream commit
https://git.xiph.org/?p=vorbis.git;a=commitdiff;h=018ca26dece618457dd13585cad52941193c4a25

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---

diff --git a/lib/psy.c b/lib/psy.c
index 422c6f1..1310123 100644
--- a/lib/psy.c
+++ b/lib/psy.c
@@ -602,8 +602,9 @@ static void bark_noise_hybridmp(int n,const long *b,
   for (i = 0, x = 0.f;; i++, x += 1.f) {
 
     lo = b[i] >> 16;
-    if( lo>=0 ) break;
     hi = b[i] & 0xffff;
+    if( lo>=0 ) break;
+    if( hi>=n ) break;
 
     tN = N[hi] + N[-lo];
     tX = X[hi] - X[-lo];
OpenPOWER on IntegriCloud