avformat/ape: fix overflow in total_blocks
This commit is contained in:
parent
8f11512273
commit
9c05f178a6
@ -146,7 +146,7 @@ static int ape_read_header(AVFormatContext * s)
|
|||||||
AVStream *st;
|
AVStream *st;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
int i, ret;
|
int i, ret;
|
||||||
int total_blocks;
|
int64_t total_blocks;
|
||||||
int64_t final_size = 0;
|
int64_t final_size = 0;
|
||||||
int64_t pts, file_size;
|
int64_t pts, file_size;
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ static int ape_read_header(AVFormatContext * s)
|
|||||||
if (!st)
|
if (!st)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
total_blocks = (ape->totalframes == 0) ? 0 : ((ape->totalframes - 1) * ape->blocksperframe) + ape->finalframeblocks;
|
total_blocks = (ape->totalframes == 0) ? 0 : ((int64_t)(ape->totalframes - 1) * ape->blocksperframe) + ape->finalframeblocks;
|
||||||
|
|
||||||
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
|
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||||
st->codecpar->codec_id = AV_CODEC_ID_APE;
|
st->codecpar->codec_id = AV_CODEC_ID_APE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user