[vlc-commits] [Git][videolan/vlc][master] lpcm: fix leak on allocation failure
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Sep 28 06:51:09 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
b85763d0 by Tristan Matthews at 2025-09-28T06:37:19+00:00
lpcm: fix leak on allocation failure
Fixes CID 1665739
- - - - -
1 changed file:
- modules/codec/lpcm.c
Changes:
=====================================
modules/codec/lpcm.c
=====================================
@@ -627,8 +627,13 @@ static block_t *EncodeFrames( encoder_t *p_enc, block_t *p_aout_buf )
for ( int i = 0; i < i_num_frames; ++i )
{
block_t *p_block = block_Alloc( i_frame_size );
- if( !p_block )
+ if( unlikely(p_block == NULL) )
+ {
+ if( p_first_block )
+ block_ChainRelease( p_first_block );
+
return NULL;
+ }
uint8_t *frame = (uint8_t *)p_block->p_buffer;
frame[0] = 1; /* one frame in packet */
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b85763d02c7aab952f0183340e8012053e2b0f38
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b85763d02c7aab952f0183340e8012053e2b0f38
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