[FFmpeg-cvslog] avcodec/pnmdec: fix decoding with AVFrame's negative linesize

Paul B Mahol git at videolan.org
Sat Sep 23 02:43:54 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Sep 23 01:40:51 2023 +0200| [5d98259841a698b58fe4ca4b95a0693f7fa587a7] | committer: Paul B Mahol

avcodec/pnmdec: fix decoding with AVFrame's negative linesize

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d98259841a698b58fe4ca4b95a0693f7fa587a7
---

 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; i<avctx->height; i++) {
                 PutBitContext pb;
-                init_put_bits(&pb, ptr, linesize);
+                init_put_bits(&pb, ptr, FFABS(linesize));
                 for(j=0; j<avctx->width * components; j++){
                     unsigned int c=0;
                     unsigned v=0;



More information about the ffmpeg-cvslog mailing list