From 5d98259841a698b58fe4ca4b95a0693f7fa587a7 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 23 Sep 2023 01:40:51 +0200 Subject: [PATCH] avcodec/pnmdec: fix decoding with AVFrame's negative linesize --- libavcodec/pnmdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index 72bc83b272..acd77ea810 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -137,7 +137,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, AVFrame *p, if(s->type < 4 || (is_mono && s->type==7)){ for (i=0; iheight; i++) { PutBitContext pb; - init_put_bits(&pb, ptr, linesize); + init_put_bits(&pb, ptr, FFABS(linesize)); for(j=0; jwidth * components; j++){ unsigned int c=0; unsigned v=0;