mov: Seek back if overreading an individual atom
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Cc: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
8f24c12be7
commit
5b4eb243bc
@ -2592,6 +2592,12 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
left = a.size - avio_tell(pb) + start_pos;
|
left = a.size - avio_tell(pb) + start_pos;
|
||||||
if (left > 0) /* skip garbage at atom end */
|
if (left > 0) /* skip garbage at atom end */
|
||||||
avio_skip(pb, left);
|
avio_skip(pb, left);
|
||||||
|
else if (left < 0) {
|
||||||
|
av_log(c->fc, AV_LOG_WARNING,
|
||||||
|
"overread end of atom '%.4s' by %"PRId64" bytes\n",
|
||||||
|
(char*)&a.type, -left);
|
||||||
|
avio_seek(pb, left, SEEK_CUR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
total_size += a.size;
|
total_size += a.size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user