diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-05-13 01:14:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-06-02 22:31:42 +0200 |
commit | 160b81ce2a87b0835125da7c72ab7ed8c0918c45 (patch) | |
tree | c2d6efb11e19c534ca04b32719f085ed74bba65f | |
parent | 19db9636c52c040d364fe9af94ddeeb1ecfd2c2a (diff) | |
download | ffmpeg-160b81ce2a87b0835125da7c72ab7ed8c0918c45.tar.gz |
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>
-rw-r--r-- | libavcodec/pcm-dvdenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pcm-dvdenc.c b/libavcodec/pcm-dvdenc.c index 1e7ee644f6..71e9b6915a 100644 --- a/libavcodec/pcm-dvdenc.c +++ b/libavcodec/pcm-dvdenc.c @@ -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; |