Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-17 12:42:36 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-10-17 12:42:41 +0400
commitf90eb8cfc8c476bd8eb974fe504eb1c5a0acd55b (patch)
treefce02a090a8fd8dbb4e72b156d98c87d564a8257 /libavformat
parent56cf6151ae9f4304d10bbe36930d0eceef59fca2 (diff)
parenta0d13d84a928110b0e99ea16d17fd758fcbde35f (diff)
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master: Add some necessary casts in the wtv demuxer. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/wtvdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index ab51171349..4aba439ee4 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -88,7 +88,7 @@ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size)
int i = wf->position >> wf->sector_bits;
if (i >= wf->nb_sectors ||
(wf->sectors[i] != wf->sectors[i - 1] + (1 << (wf->sector_bits - WTV_SECTOR_BITS)) &&
- avio_seek(pb, wf->sectors[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)) {
+ avio_seek(pb, (int64_t)wf->sectors[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)) {
wf->error = 1;
break;
}
@@ -113,7 +113,7 @@ static int64_t wtvfile_seek(void *opaque, int64_t offset, int whence)
offset = wf->length;
wf->error = offset < 0 || offset >= wf->length ||
- avio_seek(pb, (wf->sectors[offset >> wf->sector_bits] << WTV_SECTOR_BITS)
+ avio_seek(pb, ((int64_t)wf->sectors[offset >> wf->sector_bits] << WTV_SECTOR_BITS)
+ (offset & ((1 << wf->sector_bits) - 1)), SEEK_SET) < 0;
wf->position = offset;
return offset;
@@ -183,7 +183,7 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
}
wf->nb_sectors = 0;
for (i = 0; i < nb_sectors1; i++) {
- if (avio_seek(s->pb, sectors1[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)
+ if (avio_seek(s->pb, (int64_t)sectors1[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)
break;
wf->nb_sectors += read_ints(s->pb, wf->sectors + i * WTV_SECTOR_SIZE / 4, WTV_SECTOR_SIZE / 4);
}
@@ -213,7 +213,7 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
/* seek to initial sector */
wf->position = 0;
- if (avio_seek(s->pb, wf->sectors[0] << WTV_SECTOR_BITS, SEEK_SET) < 0) {
+ if (avio_seek(s->pb, (int64_t)wf->sectors[0] << WTV_SECTOR_BITS, SEEK_SET) < 0) {
av_free(wf->sectors);
av_free(wf);
return NULL;