memory leak in ImageMetadata.from_buffer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyexiv2 |
Fix Released
|
Critical
|
Olivier Tilloy |
Bug Description
in pyexiv2 0.2.0 for Windows:
in the method
Image::Image(const std::string& buffer, long size)
the buffer gets copied to Exiv2::byte* data , but it is never deleted. You should store the pointer in the Image object, and delete it in ~Image();
The bug becomes obvious with the following little script. It causes out of memory error within 10 seconds:
#######
import pyexiv2, StringIO
from PIL import Image
def test():
h = 500
w = 500
I = Image.new( "RGB", (w, h) )
S = StringIO.StringIO( )
I.save( S, "JPEG", quality = 95)
jpg_data = S.getvalue()
while 1:
metadata = pyexiv2.
test()
#######
Thank you for this very useful module!
Related branches
Changed in pyexiv2: | |
milestone: | none → 0.2.1 |
Changed in pyexiv2: | |
status: | Fix Committed → Fix Released |
I can easily reproduce (on linux, this is not platform specific) with the provided test script.