[FFmpeg-devel] [PATCH] avformat/iamf_parse: Fix return of uninitialized value

James Almer jamrial at gmail.com
Sun Sep 1 00:17:08 EEST 2024


On 8/31/2024 5:45 PM, Marvin Scholz wrote:
> The ret value here is not yet intialized so the return would return
> uninitialized data. What was probably meant to be checked here was the
> return value of ffio_read_size, which can return an error.
> 
> Introduced in 38bcb3ba7b3424abd772c72f8bdf445d75285e88
> 
> Fixes: CID1618758
> ---
>   libavformat/iamf_parse.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
> index f13e76b147..8a0003634b 100644
> --- a/libavformat/iamf_parse.c
> +++ b/libavformat/iamf_parse.c
> @@ -98,8 +98,8 @@ static int aac_decoder_config(IAMFCodecConfig *codec_config,
>           return AVERROR(ENOMEM);
>   
>       codec_config->extradata_size = ffio_read_size(pb, codec_config->extradata, left);
> -    if (ret < 0)
> -        return ret;
> +    if (codec_config->extradata_size < 0)
> +        return codec_config->extradata_size;
>       memset(codec_config->extradata + codec_config->extradata_size, 0,
>              AV_INPUT_BUFFER_PADDING_SIZE);

LGTM. Please backport to 7.0 too.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240831/ad30e8d6/attachment.sig>


More information about the ffmpeg-devel mailing list