summaryrefslogtreecommitdiff
path: root/cmd/rescribe/main.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2024-03-04 22:45:04 +0000
committerNick White <git@njw.name>2024-03-04 22:45:04 +0000
commit24cd1e74eb4de3502b53ad4cd3734f4ad4e9a5d6 (patch)
treeac6a46b21cd9cbb02c1089aeb2583cdc819f4123 /cmd/rescribe/main.go
parent409a17b82980e6801ac437606e3a5f69ae12beaa (diff)
Ensure an invalid jpeg is closed before removal is attempted, to fix crash on Windows
Diffstat (limited to 'cmd/rescribe/main.go')
-rw-r--r--cmd/rescribe/main.go1
1 files changed, 1 insertions, 0 deletions
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
}