aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-18 21:12:54 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-21 15:29:24 +0200
commit3faadbe2a27e74ff5bb5f7904ec27bb1f5287dc8 (patch)
tree08b7f8c70d28969d155b185086d78fd5b87d0519
parent167bf8f61e671833c9d1234f12973e71c414b621 (diff)
downloadffmpeg-3faadbe2a27e74ff5bb5f7904ec27bb1f5287dc8.tar.gz
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>
-rw-r--r--libavcodec/pnmdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c
index a6945549bd..59013ada49 100644
--- a/libavcodec/pnmdec.c
+++ b/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) {