summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-27 23:35:46 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-27 23:37:17 +0100
commit4156df59f59626f60186a4effed80f60c9c4e8cc (patch)
treec180637ed6049ebfbc1b231c053df2f23037408b /libavformat/mov.c
parentc09bb235bf2527c01b3b44db569dba05ffa7bdf1 (diff)
avformat/mov: check avio_read() return in mov_read_dref()
Fixes: msan_uninit-mem_7f4960453a02_7264_mr_cork_jpeg.mov Fixes use of uninitialized memory Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 940393d3b3..be602ee652 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -537,7 +537,8 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
dref->dir = av_malloc(len+1);
if (!dref->dir)
return AVERROR(ENOMEM);
- avio_read(pb, dref->dir, len);
+ if (avio_read(pb, dref->dir, len) != len)
+ return AVERROR_INVALIDDATA;
dref->dir[len] = 0;
for (j = 0; j < len; j++)
if (dref->dir[j] == ':')