[FFmpeg-devel] [PATCH 5/5] wtvdec: warn about truncated files
Peter Ross
pross at xvid.org
Sun Dec 30 13:39:14 CET 2012
---
libavformat/wtvdec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 88daa09..3121269 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)) {
--
1.8.0
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121230/b3573770/attachment.asc>
More information about the ffmpeg-devel
mailing list