You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
wtvenc: test avio_size() validity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
5a1bfa7ed7
commit
d08ea75a82
@@ -153,6 +153,7 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
|
|||||||
AVIOContext *pb;
|
AVIOContext *pb;
|
||||||
WtvFile *wf;
|
WtvFile *wf;
|
||||||
uint8_t *buffer;
|
uint8_t *buffer;
|
||||||
|
int64_t size;
|
||||||
|
|
||||||
if (seek_by_sector(s->pb, first_sector, 0) < 0)
|
if (seek_by_sector(s->pb, first_sector, 0) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -205,7 +206,8 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((int64_t)wf->sectors[wf->nb_sectors - 1] << WTV_SECTOR_BITS > avio_size(s->pb))
|
size = avio_size(s->pb);
|
||||||
|
if (size >= 0 && (int64_t)wf->sectors[wf->nb_sectors - 1] << WTV_SECTOR_BITS > size)
|
||||||
av_log(s, AV_LOG_WARNING, "truncated file\n");
|
av_log(s, AV_LOG_WARNING, "truncated file\n");
|
||||||
|
|
||||||
/* check length */
|
/* check length */
|
||||||
|
|||||||
Reference in New Issue
Block a user