Commit 8b4842c2 authored by Peter Ross's avatar Peter Ross

wtvdec: warn about truncated files

parent 801b6366
...@@ -200,6 +200,9 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int ...@@ -200,6 +200,9 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
return NULL; 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 */ /* check length */
length &= 0xFFFFFFFFFFFF; length &= 0xFFFFFFFFFFFF;
if (length > ((int64_t)wf->nb_sectors << wf->sector_bits)) { if (length > ((int64_t)wf->nb_sectors << wf->sector_bits)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment