[FFmpeg-cvslog] avformat/vqf: Check avio_read() in add_metadata()
Michael Niedermayer
git at videolan.org
Thu Jan 23 03:14:48 EET 2025
ffmpeg | branch: release/7.1 | Michael Niedermayer <michael at niedermayer.cc> | Thu Dec 26 01:46:49 2024 +0100| [30bef79c6929540655ccf7b86ce565b31f9c6564] | committer: Michael Niedermayer
avformat/vqf: Check avio_read() in add_metadata()
Fixes: use of uninitialized data
Fixes: 383825642/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5380168801124352
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit c43dbecbdad152a91eadc7538b545852eee562ae)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=30bef79c6929540655ccf7b86ce565b31f9c6564
---
libavformat/vqf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index 4820e0817c..79deb33744 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -63,7 +63,8 @@ static void add_metadata(AVFormatContext *s, uint32_t tag,
buf = av_malloc(len+1);
if (!buf)
return;
- avio_read(s->pb, buf, len);
+ if (len != avio_read(s->pb, buf, len))
+ return;
buf[len] = 0;
AV_WL32(key, tag);
av_dict_set(&s->metadata, key, buf, AV_DICT_DONT_STRDUP_VAL);
More information about the ffmpeg-cvslog
mailing list