From 7550a753565c0a1c899d36c2939b7b7e8039cd32 Mon Sep 17 00:00:00 2001 From: Alfredo Fanghella Date: Fri, 20 Oct 2017 00:38:16 -0400 Subject: [PATCH] Fixed possible out of range byte value Bytes need to be between 0 and 255, not 256 --- captcha/audio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/captcha/audio.py b/captcha/audio.py index 31a300e..577f52c 100644 --- a/captcha/audio.py +++ b/captcha/audio.py @@ -112,7 +112,7 @@ def change_sound(body, level=1): if v > 128: v = (v - 128) * level + 128 v = max(int(v), 128) - v = min(v, 256) + v = min(v, 255) elif v < 128: v = 128 - (128 - v) * level v = min(int(v), 128)