[vlc-commits] demux: asf: fix heap buffer write ofw in priorities (fix #12363)

Francois Cartegnie git at videolan.org
Fri Oct 10 15:59:09 CEST 2014


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct  9 20:29:54 2014 +0200| [bf75f88f04c4e472940d00314a997342ba30313e] | committer: Jean-Baptiste Kempf

demux: asf: fix heap buffer write ofw in priorities (fix #12363)

(cherry picked from commit 56e71fe572f9e97c8deb3cffdebdd0f0ea8979d0)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/asf/asf.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index f94472c..0c6ba0b 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -1102,7 +1102,7 @@ static void ASF_fillup_es_priorities_ex( demux_sys_t *p_sys, void *p_hdr,
         /* Just set highest prio on highest in the group */
         for ( uint16_t i = 1; i < p_mutex->i_stream_number_count; i++ )
         {
-            if ( p_prios->i_count > p_sys->i_track ) break;
+            if ( p_prios->i_count > p_sys->i_track || i > p_sys->i_track ) break;
             p_prios->pi_stream_numbers[ p_prios->i_count++ ] = p_mutex->pi_stream_number[ i ];
         }
     }
@@ -1129,7 +1129,7 @@ static void ASF_fillup_es_bitrate_priorities_ex( demux_sys_t *p_sys, void *p_hdr
         /* Just remove < highest */
         for ( uint16_t i = 1; i < p_bitrate_mutex->i_stream_number_count; i++ )
         {
-            if ( p_prios->i_count > p_sys->i_track ) break;
+            if ( p_prios->i_count > p_sys->i_track || i > p_sys->i_track ) break;
             p_prios->pi_stream_numbers[ p_prios->i_count++ ] = p_bitrate_mutex->pi_stream_numbers[ i ];
         }
     }



More information about the vlc-commits mailing list