1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/pcm-dvdenc: 64bit pkt-size

It seems nothing prevents such overflow even though odd

Fixes: CID1441934 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 160b81ce2a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-05-13 01:14:21 +02:00
parent 537a893560
commit e04470d816
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -116,7 +116,7 @@ static int pcm_dvd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
{
PCMDVDContext *s = avctx->priv_data;
int samples = frame->nb_samples * avctx->ch_layout.nb_channels;
int64_t pkt_size = (frame->nb_samples / s->samples_per_block) * s->block_size + 3;
int64_t pkt_size = (int64_t)(frame->nb_samples / s->samples_per_block) * s->block_size + 3;
int blocks = (pkt_size - 3) / s->block_size;
const int16_t *src16;
const int32_t *src32;