vlc/vlc-2.2 | branch: master | Francois Cartegnie <[email protected]> | 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 <[email protected]>

> 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 ];
         }
     }

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to