From 24cd1e74eb4de3502b53ad4cd3734f4ad4e9a5d6 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 4 Mar 2024 22:45:04 +0000 Subject: Ensure an invalid jpeg is closed before removal is attempted, to fix crash on Windows --- cmd/rescribe/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/rescribe/main.go b/cmd/rescribe/main.go index 8ae29ff..16c284c 100644 --- a/cmd/rescribe/main.go +++ b/cmd/rescribe/main.go @@ -473,6 +473,7 @@ func rmIfNotImage(f string) error { return fmt.Errorf("Failed to open image %s: %v\n", f, err) } _, err = jpeg.Decode(r) + r.Close() if err == nil { return nil } -- cgit v1.2.1-24-ge1ad