[FFmpeg-devel] [PATCH] wtvdec: when testing for truncated files, actually check the .wtv file size

Peter Ross pross at xvid.org
Sat Dec 21 09:42:23 CET 2013


Previously the demuxer was testing against avio_tell, and this would generate
many false warnings.

Signed-off-by: Peter Ross <pross at xvid.org>
---
 libavformat/wtvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 4dfe701..48f51ad 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -205,7 +205,7 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
         return NULL;
     }
 
-    if ((int64_t)wf->sectors[wf->nb_sectors - 1] << WTV_SECTOR_BITS > avio_tell(s->pb))
+    if ((int64_t)wf->sectors[wf->nb_sectors - 1] << WTV_SECTOR_BITS > avio_size(s->pb))
         av_log(s, AV_LOG_WARNING, "truncated file\n");
 
     /* check length */
-- 
1.8.3.2

-- 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/20131221/a6b1c0ad/attachment.asc>


More information about the ffmpeg-devel mailing list