Search
j0ke.net Open Build Service
>
Projects
>
multimedia
:
SL11
>
vlc
> vlc-buffer_overflow_in_real_demuxer.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File vlc-buffer_overflow_in_real_demuxer.patch of Package vlc (Revision 2)
Currently displaying revision
2
,
show latest
diff -Nur vlc-1.1.5-orig/modules/demux/real.c vlc-1.1.5/modules/demux/real.c --- vlc-1.1.5-orig/modules/demux/real.c 2010-12-31 18:54:19.593763216 +0100 +++ vlc-1.1.5/modules/demux/real.c 2010-12-31 19:00:41.758761481 +0100 @@ -252,11 +252,9 @@ if( tk->p_subpackets[ j ] ) block_Release( tk->p_subpackets[ j ] ); } - if( tk->i_subpackets ) - { - free( tk->p_subpackets ); - free( tk->p_subpackets_timecode ); - } + + free( tk->p_subpackets ); + free( tk->p_subpackets_timecode ); if( tk->p_sipr_packet ) block_Release( tk->p_sipr_packet ); free( tk ); @@ -637,6 +635,11 @@ for( int i = 0; i < i_num; i++ ) { + int i_index = tk->i_subpacket_h * i + + ((tk->i_subpacket_h + 1) / 2) * (y&1) + (y>>1); + if( i_index >= tk->i_subpackets ) + return; + block_t *p_block = block_New( p_demux, tk->i_subpacket_size ); if( !p_block ) return; @@ -649,9 +652,6 @@ p_buf += tk->i_subpacket_size; - int i_index = tk->i_subpacket_h * i + - ((tk->i_subpacket_h + 1) / 2) * (y&1) + (y>>1); - if( tk->p_subpackets[i_index] != NULL ) { msg_Dbg(p_demux, "p_subpackets[ %d ] not null!", i_index ); @@ -671,14 +671,16 @@ for( int i = 0; i < tk->i_subpacket_h / 2; i++ ) { + int i_index = (i * 2 * tk->i_frame_size / tk->i_coded_frame_size) + y; + if( i_index >= tk->i_subpackets ) + return; + block_t *p_block = block_New( p_demux, tk->i_coded_frame_size); if( !p_block ) return; if( &p_buf[tk->i_coded_frame_size] > &p_sys->buffer[p_sys->i_buffer] ) return; - int i_index = (i * 2 * tk->i_frame_size / tk->i_coded_frame_size) + y; - memcpy( p_block->p_buffer, p_buf, tk->i_coded_frame_size ); p_block->i_dts = p_block->i_pts = i_index == 0 ? i_pts : VLC_TS_INVALID;