[FFmpeg-cvslog] wtvdec: warn about truncated files

Peter Ross git at videolan.org
Mon Jan 7 13:16:20 CET 2013


ffmpeg | branch: master | Peter Ross <pross at xvid.org> | Sun Jan  6 14:15:25 2013 +1100| [8b4842c2e2cc85498a62a9987b4c2de77e027332] | committer: Peter Ross

wtvdec: warn about truncated files

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8b4842c2e2cc85498a62a9987b4c2de77e027332
---

 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)) {



More information about the ffmpeg-cvslog mailing list