diff options
author | Martijn van Beurden <mvanb1@gmail.com> | 2022-06-11 09:32:16 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-07-05 14:11:23 +0200 |
commit | c8d839df73196a9a5a03b75a12467e6e33d306f7 (patch) | |
tree | 6e5ddcbfb21ddd0aa17a3ca1c31ac963ec997790 /libavformat | |
parent | 056a9fac5b8fef3b9f5abeb5bf581a3e52e28a37 (diff) | |
download | ffmpeg-c8d839df73196a9a5a03b75a12467e6e33d306f7.tar.gz |
avformat/mov: prevent potential use of uninitialized value
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 88669faa70..5d8b24368a 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -6797,7 +6797,10 @@ static int mov_read_dfla(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); /* Flags */ - avio_read(pb, buf, sizeof(buf)); + if (avio_read(pb, buf, sizeof(buf)) != sizeof(buf)) { + av_log(c->fc, AV_LOG_ERROR, "failed to read FLAC metadata block header\n"); + return pb->error < 0 ? pb->error : AVERROR_INVALIDDATA; + } flac_parse_block_header(buf, &last, &type, &size); if (type != FLAC_METADATA_TYPE_STREAMINFO || size != FLAC_STREAMINFO_SIZE) { |