From e8cf036955bd40800acc3627077961d8fee589d0 Mon Sep 17 00:00:00 2001 From: _VIFEXTech <1290176185@qq.com> Date: Fri, 29 Apr 2022 19:29:06 +0800 Subject: [PATCH] fix(lodepng): fix NULL pointer access (#3307) Co-authored-by: pengyiqiang --- src/extra/libs/png/lodepng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extra/libs/png/lodepng.c b/src/extra/libs/png/lodepng.c index 72b849b0c..82e18e1a0 100644 --- a/src/extra/libs/png/lodepng.c +++ b/src/extra/libs/png/lodepng.c @@ -5754,7 +5754,7 @@ static unsigned preProcessScanlines(unsigned char** out, size_t* outsize, const adam7 = (unsigned char*)lodepng_malloc(passstart[7]); if(!adam7 && passstart[7]) error = 83; /*alloc fail*/ - if(!error) { + if(!error && adam7) { unsigned i; Adam7_interlace(adam7, in, w, h, bpp);