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

Francois Cartegnie git at videolan.org
Wed Feb 7 14:36:29 CET 2018


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

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

(cherry picked from commit c3f5c5f50120c9ce9a2e7bb933ae6880b6fad26f)

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

 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