File wavpack-fix-word-boundaries.patch of Package wavpack.18769
From: Karol Babioch <kbabioch@suse.de>
Date: Wed Feb 28 13:18:02 CET 2018
References: https://github.com/dbry/WavPack/commit/4bc05fc490b66ef2d45b1de26abf1455b486b0dc
References: https://bugzilla.suse.com/show_bug.cgi?id=1021483
Upstream: merged
Subject: Make sure high and low boundaries are senseful
This is taken from upstream commit 4bc05fc490b66ef2d45b1de26abf1455b486b0dc.
The read_new_config_info() function is not yet present, and hence only the
upper and lower boundary check is needed.
This fixes bsc#1021483.
---
src/words.c | 4 ++++
1 file changed, 4 insertions(+)
Index: wavpack-4.70.0/src/words.c
===================================================================
--- wavpack-4.70.0.orig/src/words.c
+++ wavpack-4.70.0/src/words.c
@@ -1151,6 +1151,10 @@ int32_t FASTCALL get_word (WavpackStream
low &= 0x7fffffff;
high &= 0x7fffffff;
+
+ if (low > high) // make sure high and low make sense
+ high = low;
+
mid = (high + low + 1) >> 1;
if (!c->error_limit)