avformat/iamf_parse: Fix return of uninitialized value

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 38bcb3ba7b

Fixes: CID1618758
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Marvin Scholz 2024-08-31 22:45:31 +02:00 committed by James Almer
parent 8a2c401625
commit b6a0eab528
1 changed files with 2 additions and 1 deletions

View File

@ -97,9 +97,10 @@ static int aac_decoder_config(IAMFCodecConfig *codec_config,
if (!codec_config->extradata) if (!codec_config->extradata)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
codec_config->extradata_size = ffio_read_size(pb, codec_config->extradata, left); ret = ffio_read_size(pb, codec_config->extradata, left);
if (ret < 0) if (ret < 0)
return ret; return ret;
codec_config->extradata_size = left;
memset(codec_config->extradata + codec_config->extradata_size, 0, memset(codec_config->extradata + codec_config->extradata_size, 0,
AV_INPUT_BUFFER_PADDING_SIZE); AV_INPUT_BUFFER_PADDING_SIZE);