[vlc-devel] [PATCH] SAPI: Fix an off-by-one error in voice selection

Moti Zilberman motiz88 at gmail.com
Mon Oct 12 11:55:58 CEST 2015


---
 modules/text_renderer/sapi.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/text_renderer/sapi.cpp b/modules/text_renderer/sapi.cpp
index 501cdef..9f183b6 100644
--- a/modules/text_renderer/sapi.cpp
+++ b/modules/text_renderer/sapi.cpp
@@ -124,7 +124,7 @@ static int Create (vlc_object_t *p_this)
                 int voiceIndex = var_InheritInteger(p_this, "sapi-voice");
                 if (voiceIndex > -1)
                 {
-                    if ((unsigned)voiceIndex <= ulCount) {
+                    if ((unsigned)voiceIndex < ulCount) {
                         hr = cpEnum->Item(voiceIndex, &cpVoiceToken);
                         if (SUCCEEDED(hr)) {
                             hr = p_sys->cpVoice->SetVoice(cpVoiceToken);
-- 
1.9.4.msysgit.2



More information about the vlc-devel mailing list