Browse Source

mov: detect EOF in mov_read_dref()

Avoid a near infinite loop.
Issue discovered by cosminamironesei.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
tags/n1.0
Michael Niedermayer Luca Barbato 14 years ago
parent
commit
9db67bedf0
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/mov.c

+ 2
- 0
libavformat/mov.c View File

@@ -416,6 +416,8 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_skip(pb, 16); avio_skip(pb, 16);


for (type = 0; type != -1 && avio_tell(pb) < next; ) { for (type = 0; type != -1 && avio_tell(pb) < next; ) {
if (pb->eof_reached)
return AVERROR_EOF;
type = avio_rb16(pb); type = avio_rb16(pb);
len = avio_rb16(pb); len = avio_rb16(pb);
av_log(c->fc, AV_LOG_DEBUG, "type %d, len %d\n", type, len); av_log(c->fc, AV_LOG_DEBUG, "type %d, len %d\n", type, len);


Loading…
Cancel
Save