summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2022-06-11 09:32:16 +0200
committerPaul B Mahol <onemda@gmail.com>2022-07-05 14:11:23 +0200
commitc8d839df73196a9a5a03b75a12467e6e33d306f7 (patch)
tree6e5ddcbfb21ddd0aa17a3ca1c31ac963ec997790 /libavformat
parent056a9fac5b8fef3b9f5abeb5bf581a3e52e28a37 (diff)
avformat/mov: prevent potential use of uninitialized value
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c5
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) {