summaryrefslogtreecommitdiffstats
path: root/backend_mitsud90.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-02-27 20:03:19 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-02-27 20:03:19 -0500
commit50dc67e8c390781d8151c949ae161371e0501089 (patch)
tree722cb611cff7039e884f78bc468127caec40fd3c /backend_mitsud90.c
parentcbddb4f63a9f35d3587b4f29ba4ebfb0fa59852d (diff)
downloadselphy_print-50dc67e8c390781d8151c949ae161371e0501089.tar.gz
selphy_print-50dc67e8c390781d8151c949ae161371e0501089.tar.bz2
selphy_print-50dc67e8c390781d8151c949ae161371e0501089.zip
mitsu_m1: Don't forget to free the CPC data.
Diffstat (limited to 'backend_mitsud90.c')
-rw-r--r--backend_mitsud90.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/backend_mitsud90.c b/backend_mitsud90.c
index a94e53e..fe61e85 100644
--- a/backend_mitsud90.c
+++ b/backend_mitsud90.c
@@ -794,6 +794,7 @@ static uint8_t M1_calc_oprate_matte(uint16_t rows, uint16_t cols, uint8_t *data)
static int cpm1_fillmatte(struct mitsud90_printjob *job);
static struct M1CPCData *get_M1CPCData(const char *filename,
const char *gammafilename);
+static void free_M1CPCData(struct M1CPCData *dat);
static void M1_gamma8to14(const struct M1CPCData *cpc,
const struct BandImage *in, struct BandImage *out);
@@ -884,8 +885,11 @@ static int mitsud90_main_loop(void *vctx, const void *vjob) {
if (job->hdr.overcoat == 3) {
uint8_t *ptr = convbuf + (output.rows * output.cols * 2 * 3);
ret = cpm1_fillmatte(job);
- if (ret)
+ if (ret) {
+ mitsud90_cleanup_job(job);
+ free_M1CPCData(cpc);
return ret;
+ }
job->hdr.oprate = M1_calc_oprate_matte(output.rows,
output.cols,
ptr);
@@ -1851,6 +1855,11 @@ static int M1_calc_rgbrate(uint16_t rows, uint16_t cols, uint8_t *data)
return (uint8_t)d;
}
+static void free_M1CPCData(struct M1CPCData *dat)
+{
+ free(dat);
+}
+
static struct M1CPCData *get_M1CPCData(const char *filename,
const char *gammafilename)
{