plug-ins: fix segfault in apply-canvas

(cherry picked from commit 1a8848be87665cb8c9b63a5e2567cd7dbccced93)