summaryrefslogtreecommitdiff
path: root/libavformat/wtvenc.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2012-12-18 00:42:13 +1100
committerPeter Ross <pross@xvid.org>2012-12-19 00:18:17 +1100
commit95015634f5017897a61f4883bc217b0f7efbc40c (patch)
treebb7905f2aa26489cb15edd7148db384bcc271a5a /libavformat/wtvenc.c
parentebfb738fa4b0dcefb14586be5d1dc0b44c91d6c2 (diff)
downloadffmpeg-95015634f5017897a61f4883bc217b0f7efbc40c.tar.gz
wtv: permit root table and first sectors to be located beyond 2GB boundary
Fixes ticket #2025. Signed-off-by: Peter Ross <pross@xvid.org>
Diffstat (limited to 'libavformat/wtvenc.c')
-rw-r--r--libavformat/wtvenc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index 8300662c13..304bd14f74 100644
--- a/libavformat/wtvenc.c
+++ b/libavformat/wtvenc.c
@@ -546,7 +546,7 @@ static void write_fat(AVIOContext *pb, int start_sector, int nb_sectors, int shi
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)
+static int64_t write_fat_sector(AVFormatContext *s, int64_t start_pos, int nb_sectors, int sector_bits, int depth)
{
int64_t start_sector = start_pos >> WTV_SECTOR_BITS;
int shift = sector_bits - WTV_SECTOR_BITS;
@@ -672,11 +672,10 @@ static int finish_file(AVFormatContext *s, enum WtvFileIndex index, int64_t star
//write fat table
if (w->depth > 0) {
- w->first_sector = write_fat_sector(s, start_pos, nb_sectors, sector_bits, w->depth);
+ w->first_sector = write_fat_sector(s, start_pos, nb_sectors, sector_bits, w->depth) >> WTV_SECTOR_BITS;
} else {
- w->first_sector = start_pos;
+ w->first_sector = start_pos >> WTV_SECTOR_BITS;
}
- w->first_sector >>= WTV_SECTOR_BITS;
w->length |= 1ULL<<60;
if (sector_bits == WTV_SECTOR_BITS)