From 8b4842c2e2cc85498a62a9987b4c2de77e027332 Mon Sep 17 00:00:00 2001 From: Peter Ross Date: Sun, 6 Jan 2013 14:15:25 +1100 Subject: wtvdec: warn about truncated files --- libavformat/wtvdec.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat/wtvdec.c') diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 88daa095b9..3121269cf8 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -200,6 +200,9 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int return NULL; } + if (wf->sectors[wf->nb_sectors - 1] << WTV_SECTOR_BITS > avio_tell(s->pb)) + av_log(s, AV_LOG_WARNING, "truncated file\n"); + /* check length */ length &= 0xFFFFFFFFFFFF; if (length > ((int64_t)wf->nb_sectors << wf->sector_bits)) { -- cgit v1.2.3