Skip to content

JBIG2Stream: fix leak in reset() if called several times

Even Rouault requested to merge rouault/poppler:fix_leak_in_jbig2stream into master

JBIG2Stream::reset() currently allocates new values for the segments and globalSegments member variable. This causes a memory leak if the method is called several times, which can be triggered by the GDAL library that uses Poppler. So add a freeSegments() method where we move the related cleanup of close(), and call that method from reset() and close().

Edited by Even Rouault

Merge request reports