avcodec/mpeg12dec: Use 64bit in bit computation

I dont think this can actually overflow but 64bit seems reasonable to use

Fixes: CID1521983 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4c725df059)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/6.1
Michael Niedermayer 8 months ago
parent d54198256e
commit 94849755fb
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      libavcodec/mpeg12dec.c

@ -2934,7 +2934,7 @@ static int ipu_decode_frame(AVCodecContext *avctx, AVFrame *frame,
int ret;
// Check for minimal intra MB size (considering mb header, luma & chroma dc VLC, ac EOB VLC)
if (avpkt->size*8LL < (avctx->width+15)/16 * ((avctx->height+15)/16) * (2 + 3*4 + 2*2 + 2*6))
if (avpkt->size*8LL < (avctx->width+15)/16 * ((avctx->height+15)/16) * (2LL + 3*4 + 2*2 + 2*6))
return AVERROR_INVALIDDATA;
ret = ff_get_buffer(avctx, frame, 0);

Loading…
Cancel
Save