summaryrefslogtreecommitdiff
path: root/libavformat/wtvdec.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2013-01-06 14:15:25 +1100
committerPeter Ross <pross@xvid.org>2013-01-07 23:14:58 +1100
commit8b4842c2e2cc85498a62a9987b4c2de77e027332 (patch)
tree89ff872212ac906e422f34f173e89a6154cebed3 /libavformat/wtvdec.c
parent801b636633ea80e15af4f22d148b2981f573d739 (diff)
wtvdec: warn about truncated files
Diffstat (limited to 'libavformat/wtvdec.c')
-rw-r--r--libavformat/wtvdec.c3
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)) {