mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
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@niedermayer.cc>
(cherry picked from commit c43dbecbda)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -61,7 +61,8 @@ static void add_metadata(AVFormatContext *s, uint32_t tag,
|
|||||||
buf = av_malloc(len+1);
|
buf = av_malloc(len+1);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return;
|
return;
|
||||||
avio_read(s->pb, buf, len);
|
if (len != avio_read(s->pb, buf, len))
|
||||||
|
return;
|
||||||
buf[len] = 0;
|
buf[len] = 0;
|
||||||
AV_WL32(key, tag);
|
AV_WL32(key, tag);
|
||||||
av_dict_set(&s->metadata, key, buf, AV_DICT_DONT_STRDUP_VAL);
|
av_dict_set(&s->metadata, key, buf, AV_DICT_DONT_STRDUP_VAL);
|
||||||
|
|||||||
Reference in New Issue
Block a user