[vlc-devel] [PATCH] directsound: Fix volume range
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Tue Dec 27 17:31:43 CET 2016
Setting an integer limit on a float will yield UB when trying to clamp
the volume within its given range.
Fix #17659
---
modules/audio_output/directsound.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/audio_output/directsound.c b/modules/audio_output/directsound.c
index 55f1e7ada6..80be4ef627 100644
--- a/modules/audio_output/directsound.c
+++ b/modules/audio_output/directsound.c
@@ -87,7 +87,7 @@ vlc_module_begin ()
change_string_list( speaker_list, speaker_list )
add_float( "directx-volume", 1.0f,
VOLUME_TEXT, VOLUME_LONGTEXT, true )
- change_integer_range( DSBVOLUME_MIN, DSBVOLUME_MAX )
+ change_float_range( 0.f, 2.f )
set_callbacks( Open, Close )
--
2.11.0
More information about the vlc-devel
mailing list