[vlc-commits] codec: faad: fix stack buffer overflow with invalid channels count

Francois Cartegnie git at videolan.org
Wed Feb 7 11:43:00 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Feb  7 11:28:51 2018 +0100| [c3f5c5f50120c9ce9a2e7bb933ae6880b6fad26f] | committer: Francois Cartegnie

codec: faad: fix stack buffer overflow with invalid channels count

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c3f5c5f50120c9ce9a2e7bb933ae6880b6fad26f
---

 modules/codec/faad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/faad.c b/modules/codec/faad.c
index 8de1f7824b..cd415b6c5c 100644
--- a/modules/codec/faad.c
+++ b/modules/codec/faad.c
@@ -519,7 +519,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
         bool b_reorder = false;
         if (p_dec->fmt_out.audio.channel_type == AUDIO_CHANNEL_TYPE_BITMAP)
         {
-            for( size_t i = 0; i < frame.channels; i++ )
+            for( size_t i = 0; i < frame.channels && i < FAAD_CHANNEL_ID_COUNT; i++ )
             {
                 unsigned pos = frame.channel_position[i];
                 if( likely(pos < FAAD_CHANNEL_ID_COUNT) )



More information about the vlc-commits mailing list