[vlc-commits] [Git][videolan/vlc][3.0.x] packetizer: mpeg4audio: don't allocate a size of 0
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Jul 31 07:37:01 UTC 2026
Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC
Commits:
7fae5144 by Steve Lhomme at 2026-07-31T07:26:51+00:00
packetizer: mpeg4audio: don't allocate a size of 0
Depending on the allocator it may return NULL or an allocated pointer.
In the former case b_latm_cfg is set to false, in the latter case b_latm_cfg is
set to true.
The code below may turn a b_latm_cfg to true, but if i_extra is not 0
which is not the case here.
The expected behavior is probably to have b_latm_cfg set to false if i_extra is 0.
Ref. #29831
(cherry picked from commit 13fb40e50d6f2ad2270adaf7e427d9f405016842)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
- - - - -
1 changed file:
- modules/packetizer/mpeg4audio.c
Changes:
=====================================
modules/packetizer/mpeg4audio.c
=====================================
@@ -835,7 +835,7 @@ static int LOASParse(decoder_t *p_dec, uint8_t *p_buffer, int i_buffer)
{
if(p_dec->fmt_out.i_extra)
free(p_dec->fmt_out.p_extra);
- p_dec->fmt_out.p_extra = malloc(st->i_extra);
+ p_dec->fmt_out.p_extra = st->i_extra ? malloc(st->i_extra) : NULL;
if(p_dec->fmt_out.p_extra)
{
p_dec->fmt_out.i_extra = st->i_extra;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7fae5144aa2d7381d534b99c5da76d5c31c619c2
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7fae5144aa2d7381d534b99c5da76d5c31c619c2
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list