mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
unref the image *after* we used it
Otherwise we manipulate potentially deallocated memory. On some distributions things go fine for some reason, but on others the memory actually gets deallocated and garbage is used, leading to a segmentation fault in vips_image_guess_interpretation Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
This commit is contained in:
parent
0fcfb9757f
commit
58fb35672e
1 changed files with 2 additions and 1 deletions
3
vips.go
3
vips.go
|
|
@ -388,8 +388,9 @@ func vipsInterpretationBuffer(buf []byte) (Interpretation, error) {
|
|||
if err != nil {
|
||||
return InterpretationError, err
|
||||
}
|
||||
interp := vipsInterpretation(image)
|
||||
C.g_object_unref(C.gpointer(image))
|
||||
return vipsInterpretation(image), nil
|
||||
return interp, nil
|
||||
}
|
||||
|
||||
func vipsInterpretation(image *C.VipsImage) Interpretation {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue