diff options
author | Zhang Rui <bbcallen@gmail.com> | 2015-05-21 06:48:55 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-21 19:48:18 +0300 |
commit | c886dd2f5875e01a5949fddd0388c965c7766cfb (patch) | |
tree | 1534d5632ceb4a420e4497736041b294741772aa /libavformat/mov.c | |
parent | 18833daf9d1b4e380065b107173fba76d7b46067 (diff) |
avformat/mov: check result of avio_seek
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-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 ed2afd4215..f6f07be554 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4240,7 +4240,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) mov->found_mdat = 0; if (!mov->next_root_atom) return AVERROR_EOF; - avio_seek(s->pb, mov->next_root_atom, SEEK_SET); + if (avio_seek(s->pb, mov->next_root_atom, SEEK_SET) != mov->next_root_atom) { + av_log(mov->fc, AV_LOG_ERROR, "next root atom offset 0x%"PRIx64": partial file\n", mov->next_root_atom); + return AVERROR_INVALIDDATA; + } mov->next_root_atom = 0; if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 || avio_feof(s->pb)) |