-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
The attached patch addresses this crash, which happens with specific ill-formed jpegs.
diff --git a/vips.go b/vips.go
index 36118e1..14cd90a 100644
--- a/vips.go
+++ b/vips.go
@@ -311,6 +311,10 @@ func Resize(buf []byte, o Options) ([]byte, error) {
C.vips_colourspace_0(image, &tmpImage, C.VIPS_INTERPRETATION_sRGB)
C.g_object_unref(C.gpointer(image))
image = tmpImage
+ if image == nil {
+ debug("colourspace conversion failed")
+ return nil, resizeError()
+ }
// Finally save
length := C.size_t(0)
Metadata
Metadata
Assignees
Labels
No labels