[vlc-commits] [Git][videolan/vlc][master] 3 commits: speex: rtp: fix leak on decoding error
Steve Lhomme (@robUx4)
gitlab at videolan.org
Wed Sep 24 13:14:57 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
83213a98 by Tristan Matthews at 2025-09-24T12:58:16+00:00
speex: rtp: fix leak on decoding error
Fixes CID #1665523
- - - - -
2756323f by Tristan Matthews at 2025-09-24T12:58:16+00:00
speex: fix leak on decoding error or EOS
Fixes CID #1665515
- - - - -
f2523148 by Tristan Matthews at 2025-09-24T12:58:16+00:00
speex: assert against empty frame_size in header
- - - - -
1 changed file:
- modules/codec/speex.c
Changes:
=====================================
modules/codec/speex.c
=====================================
@@ -744,6 +744,7 @@ static int DecodeRtpSpeexPacket( decoder_t *p_dec, block_t *p_speex_bit_block )
if ( date_Get( &p_sys->end_date ) == VLC_TICK_INVALID )
date_Set( &p_sys->end_date, p_speex_bit_block->i_dts );
+ assert( p_sys->p_header->frame_size > 0 );
/*
Ask for a new audio output buffer and make sure
we get one.
@@ -753,7 +754,7 @@ static int DecodeRtpSpeexPacket( decoder_t *p_dec, block_t *p_speex_bit_block )
else
p_aout_buffer = decoder_NewAudioBuffer( p_dec,
p_sys->p_header->frame_size );
- if ( !p_aout_buffer || p_aout_buffer->i_buffer == 0 )
+ if ( !p_aout_buffer )
{
msg_Err(p_dec, "Oops: No new buffer was returned!");
return VLCDEC_SUCCESS;
@@ -774,6 +775,7 @@ static int DecodeRtpSpeexPacket( decoder_t *p_dec, block_t *p_speex_bit_block )
(int16_t*)p_aout_buffer->p_buffer );
if ( i_decode_ret < 0 )
{
+ block_Release( p_aout_buffer );
msg_Err( p_dec, "Decoding failed. Perhaps we have a bad stream?" );
return VLCDEC_SUCCESS;
}
@@ -830,6 +832,7 @@ static block_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
msg_Err( p_dec, "decoding error: corrupted stream?" );
/* fall through */
case -1: /* End of stream */
+ block_Release( p_aout_buffer );
return NULL;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/75683e7e07842aaaf59109bda293d1744bf5b4cc...f25231481734e10f06f84fcc8341e402987b163b
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/75683e7e07842aaaf59109bda293d1744bf5b4cc...f25231481734e10f06f84fcc8341e402987b163b
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list