There are memory leaks in [...]

When the writer fails to close, right?

Oh yes, sorry about that! An additional delete[] row; should clean it up nicely.


On 7/16/2010 3:32 PM, Albert Astals Cid wrote:
A Dissabte, 10 de juliol de 2010, Stefan Thomas va escriure:
Hello!

I've got two new patches for the cause.

The first one adds transparent PNG support to PNGWriter and
SplashBitmap. The uses for this are varied and many, so I think it makes
sense to add this to the mainline, even though I don't have the pdftoppm
patch to go along with it. (We're using it in a custom SplashOutputDev.)
Seems like it duplicates some code from the other method, would it be
possible to merge them a bit more?

The second one fixes a nasty bug in SplashBitmap that causes "pdftoppm
-jpeg" to randomly produce corrupt images. Currently SplashBitmap frees
its temporary buffers and later calls ImgWriter::close(). Problem is
libjpeg still uses these temporary buffers during
jpeg_finish_compress(). So if they've been reclaimed - bad things
happen. Usually libjpeg aborts and produces an image with the bottom
fifty or so rows missing. The patch also fixes the SplashBitmap throwing
a splashErrGeneric despite success, which was due to a missing question
mark before writer->close().
valgrind does not complain about it when i do

    valgrind ./utils/pdftoppm -jpeg ~/pdf_reference_1-7.pdf -f 1 -l 1 foo

Are you sure that is the problem?

Albert

Hope you find it useful.

Cheers,

Stefan Thomas
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to