[vlc-devel] [PATCH] Audio core: avoid FPE in aout_ChannelReorder

Jean-Baptiste Kempf jb at videolan.org
Thu Oct 10 10:54:05 CEST 2013


aout_BitsPerSample can return 0 in some valid situations
---
 src/audio_output/common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/audio_output/common.c b/src/audio_output/common.c
index b66f16c..51ce0fc 100644
--- a/src/audio_output/common.c
+++ b/src/audio_output/common.c
@@ -322,6 +322,8 @@ do { \
         default:
         {
             unsigned size = aout_BitsPerSample( fourcc ) / 8;
+            if( size == 0 ) return;
+
             const size_t frames = bytes / (size * channels);
             unsigned char *buf = ptr;
 
-- 
1.8.4




More information about the vlc-devel mailing list