diff --git a/video/image_writer.c b/video/image_writer.c index b3bfd31602..a61455d6f3 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -270,6 +270,7 @@ static bool write_jpeg(struct image_writer_ctx *ctx, mp_image_t *image, cinfo.client_data = &error_return_jmpbuf; if (setjmp(cinfo.client_data)) { jpeg_destroy_compress(&cinfo); + fclose(fp); return false; }