[FFmpeg-cvslog] wtvenc: ensure fat tables are padded to the sector boundary

Peter Ross git at videolan.org
Sun Nov 6 02:58:30 CET 2011


ffmpeg | branch: master | Peter Ross <pross at xvid.org> | Sun Nov  6 12:14:31 2011 +1100| [b372723f6a60f362e7b007a4bac2fac68da90b13] | committer: Michael Niedermayer

wtvenc: ensure fat tables are padded to the sector boundary

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/wtvenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index 887ee72..d1c446c 100644
--- a/libavformat/wtvenc.c
+++ b/libavformat/wtvenc.c
@@ -532,7 +532,7 @@ static void write_fat(AVIOContext *pb, int start_sector, int nb_sectors, int shi
         avio_wl32(pb, start_sector + (i << shift));
     }
     // pad left sector pointer size
-    write_pad(pb, WTV_SECTOR_SIZE - (nb_sectors << 2));
+    write_pad(pb, WTV_SECTOR_SIZE - ((nb_sectors << 2) % WTV_SECTOR_SIZE));
 }
 
 static int write_fat_sector(AVFormatContext *s, int64_t start_pos, int nb_sectors, int sector_bits, int depth)



More information about the ffmpeg-cvslog mailing list