avcodec/pnmdec: Use 64bit for input size check

Fixes: out of array read
Fixes: poc3

Reported-by: VulDB CNA Team
Found-by: CookedMelon
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.1
Michael Niedermayer 4 months ago
parent 167bf8f61e
commit 3faadbe2a2
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      libavcodec/pnmdec.c

@ -262,7 +262,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, AVFrame *p,
break;
case AV_PIX_FMT_GBRPF32:
if (!s->half) {
if (avctx->width * avctx->height * 12 > s->bytestream_end - s->bytestream)
if (avctx->width * avctx->height * 12LL > s->bytestream_end - s->bytestream)
return AVERROR_INVALIDDATA;
scale = 1.f / s->scale;
if (s->endian) {

Loading…
Cancel
Save