[FFmpeg-cvslog] avformat/iamf_parse: Fix return of uninitialized value
Marvin Scholz
git at videolan.org
Sun Sep 1 03:22:44 EEST 2024
ffmpeg | branch: release/7.0 | Marvin Scholz <epirat07 at gmail.com> | Sat Aug 31 22:45:31 2024 +0200| [47844f58691feae90e3df7444c00631a94a65bba] | committer: James Almer
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 38bcb3ba7b3424abd772c72f8bdf445d75285e88
Fixes: CID1618758
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit b6a0eab528695c39a0c52889db0c1ce5dd6d99f3)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=47844f58691feae90e3df7444c00631a94a65bba
---
libavformat/iamf_parse.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
index 7d635402cf..c8b58921b4 100644
--- a/libavformat/iamf_parse.c
+++ b/libavformat/iamf_parse.c
@@ -97,9 +97,10 @@ static int aac_decoder_config(IAMFCodecConfig *codec_config,
if (!codec_config->extradata)
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)
return ret;
+ codec_config->extradata_size = left;
memset(codec_config->extradata + codec_config->extradata_size, 0,
AV_INPUT_BUFFER_PADDING_SIZE);
More information about the ffmpeg-cvslog
mailing list