Avoid a near infinite loop. Issue discovered by cosminamironesei.
Unified · Split
| @@ -416,6 +416,8 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 415 unmodified lines | ||
| 416 | 416 | avio_skip(pb, 16); |
| 417 | 417 | |
| 418 | 418 | for (type = 0; type != -1 && avio_tell(pb) < next; ) { |
| 419 | + if (pb->eof_reached) | |
| 420 | + return AVERROR_EOF; | |
| 419 | 421 | type = avio_rb16(pb); |
| 420 | 422 | len = avio_rb16(pb); |
| 421 | 423 | av_log(c->fc, AV_LOG_DEBUG, "type %d, len %d\n", type, len); |