diff options
author | Peter Ross <pross@xvid.org> | 2013-01-06 14:15:25 +1100 |
---|---|---|
committer | Peter Ross <pross@xvid.org> | 2013-01-07 23:14:58 +1100 |
commit | 8b4842c2e2cc85498a62a9987b4c2de77e027332 (patch) | |
tree | 89ff872212ac906e422f34f173e89a6154cebed3 /libavformat/wtvdec.c | |
parent | 801b636633ea80e15af4f22d148b2981f573d739 (diff) | |
download | ffmpeg-8b4842c2e2cc85498a62a9987b4c2de77e027332.tar.gz |
wtvdec: warn about truncated files
Diffstat (limited to 'libavformat/wtvdec.c')
-rw-r--r-- | libavformat/wtvdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
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)) { |