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

Francois Cartegnie git at videolan.org
Fri Oct 10 00:01:57 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct  9 20:29:54 2014 +0200| [56e71fe572f9e97c8deb3cffdebdd0f0ea8979d0] | committer: Francois Cartegnie

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

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

 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 a9d14b4..017a356 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -694,7 +694,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 ];
         }
     }
@@ -721,7 +721,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