File soundtouch-adjust-bounds.patch of Package soundtouch.9661

From 244fbeac24211a967cdcd523d46af5d9d3e83b57 Mon Sep 17 00:00:00 2001
From: Olli Parviainen <oparviai@iki.fi>
Date: Mon, 7 Jan 2019 18:55:36 +0200
Subject: [PATCH] BPM PeakFinder: Fix possible reading past end of array.

Increase minor version accordingly.
---
 README.html                      | 11 ++++++++---
 include/SoundTouch.h             |  4 ++--
 source/SoundTouch/PeakFinder.cpp |  2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/source/SoundTouch/PeakFinder.cpp b/source/SoundTouch/PeakFinder.cpp
index 258571a..34db39b 100644
--- a/source/SoundTouch/PeakFinder.cpp
+++ b/source/SoundTouch/PeakFinder.cpp
@@ -142,7 +142,7 @@ int PeakFinder::findCrossingLevel(const float *data, float level, int peakpos, i
     peaklevel = data[peakpos];
     assert(peaklevel >= level);
     pos = peakpos;
-    while ((pos >= minPos) && (pos < maxPos))
+    while ((pos >= minPos) && (pos + direction < maxPos))
     {
         if (data[pos + direction] < level) return pos;   // crossing found
         pos += direction;
-- 
2.18.1

openSUSE Build Service is sponsored by