GNOME Bugzilla – Bug 163333
[pngenc] Remove the buffer == file assumption
Last modified: 2005-08-29 15:42:42 UTC
Right now pngenc assumes that the buffer is preciesly equal to the whole data it must process. That breaks spectacularly when using something like this: gst-launch filesrc location=test.raw ! video/x-raw-rgb,depth=(int)32,bpp=(int)32,width=(int)48,height=(int)48 ! pngenc ! filesink location=out.png In my tests, out.png contained only a part of the input data (the first 1024 bytes encoded into png, which is no suprise). Attached will be a patch that removes this assumption.
Created attachment 35659 [details] [review] Patch to resolve the problem This patch makes pngenc store its incoming buffers until the whole image arrives, and then doing the compression. Apart from this, a few memory leaks are plugged by this patch, and the filters behaviour on errors from libpng is improved (in some sense at least.. now it uses GST_ELEMENT_ERROR, before it only issued a warning, which might have lead to interesting results). The patch should be applied on top of the patch I submitted to bug#163323 (compression level customisation support for pngenc). If needed, I can provide a patch that does not depend on that other one.