Skip to content

Commit

Permalink
avformat/vqf: Check avio_read() in add_metadata()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
michaelni committed Jan 21, 2025
1 parent 54897da commit c43dbec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libavformat/vqf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c43dbec

Please sign in to comment.