Skip to content

Commit cdea0dd

Browse files
committed
Merge branch '8.15'
2 parents 0debb43 + 4f26536 commit cdea0dd

File tree

8 files changed

+84
-91
lines changed

8 files changed

+84
-91
lines changed

ChangeLog

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ master 8.16
2727

2828
8.15.4
2929

30-
- heifsave: fix crash when passing an invalid bitdepth
3130
- fix an off-by-one error in vips__token_get()
31+
- heifsave: fix crash when passing an invalid bitdepth [kleisauke]
32+
- webpsave: fix memory leak on error [dloebl]
33+
- heifsave: ensure NCLX profile is freed in lossless mode [kleisauke]
34+
- threadpool: fix a race condition in error handling [kleisauke]
3235

3336
11/8/24 8.15.3
3437

libvips/foreign/heifsave.c

+9-3
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ vips_foreign_save_heif_write_page(VipsForeignSaveHeif *heif, int page)
270270

271271
struct heif_error error;
272272
struct heif_encoding_options *options;
273+
#ifdef HAVE_HEIF_ENCODING_OPTIONS_OUTPUT_NCLX_PROFILE
274+
struct heif_color_profile_nclx *nclx = NULL;
275+
#endif
273276

274277
#ifdef HAVE_HEIF_COLOR_PROFILE
275278
/* A profile supplied as an argument overrides an embedded
@@ -294,10 +297,10 @@ vips_foreign_save_heif_write_page(VipsForeignSaveHeif *heif, int page)
294297
* mode.
295298
*/
296299
if (heif->lossless) {
297-
struct heif_color_profile_nclx *nclx;
298-
299-
if (!(nclx = heif_nclx_color_profile_alloc()))
300+
if (!(nclx = heif_nclx_color_profile_alloc())) {
301+
heif_encoding_options_free(options);
300302
return -1;
303+
}
301304

302305
nclx->matrix_coefficients = heif_matrix_coefficients_RGB_GBR;
303306
options->output_nclx_profile = nclx;
@@ -326,6 +329,9 @@ vips_foreign_save_heif_write_page(VipsForeignSaveHeif *heif, int page)
326329
#endif /*DEBUG*/
327330

328331
heif_encoding_options_free(options);
332+
#ifdef HAVE_HEIF_ENCODING_OPTIONS_OUTPUT_NCLX_PROFILE
333+
VIPS_FREEF(heif_nclx_color_profile_free, nclx);
334+
#endif
329335

330336
if (error.code) {
331337
vips__heif_error(&error);

0 commit comments

Comments
 (0)