From a96e25a44218a9530a26dbc70cf347a3e426e1a1 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Thu, 14 Nov 2019 18:47:04 +0600 Subject: [PATCH] Fix segfaults on watermarking in somme cases --- CHANGELOG.md | 3 +++ process.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 875a9ba1..dbda6d09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ ### Changed - Boolean processing options such as `enlarge` and `extend` are properly parsed. `1`, `t`, `TRUE`, `true`, `True` are truthy, `0`, `f`, `F`, `FALSE`, `false`, `False` are falsy. All other values are treated as falsy and generate a warning message. +### Fixed +- Fix segfaults on watermarking in somme cases + ## [2.6.2] - 2019-11-11 ### Fixed - Fix `format` option in presets. diff --git a/process.go b/process.go index 6c390a54..91d50f1a 100644 --- a/process.go +++ b/process.go @@ -252,6 +252,10 @@ func applyWatermark(img *vipsImage, wmData *imageData, opts *watermarkOptions, f return err } + if err := img.CopyMemory(); err != nil { + return err + } + wm := new(vipsImage) defer wm.Clear()