Merge pull request #90 from aarti/master

Take care to not dereference the original image a second time
master
Tomás Aparicio 10 years ago committed by GitHub
commit 129892593e

@ -318,7 +318,12 @@ func vipsSave(image *C.VipsImage, o vipsSaveOptions) ([]byte, error) {
if err != nil {
return nil, err
}
//When an image has an unsupported color space, vipsPreSave returns the pointer of the image passed to it unmodified.
//When this occurs, we must take care to not dereference the original image a second time;
//we may otherwise erroneously free the object twice
if tmpImage != image {
defer C.g_object_unref(C.gpointer(tmpImage))
}
length := C.size_t(0)
saveErr := C.int(0)

Loading…
Cancel
Save