From bb5f973ab4e0350ea2aa6e3c29a6539e00a08593 Mon Sep 17 00:00:00 2001 From: Dirk Farin Date: Sun, 20 Oct 2024 14:06:58 +0200 Subject: [PATCH] fix memory leak when dav1d initialization fails --- libheif/plugins/decoder_dav1d.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/libheif/plugins/decoder_dav1d.cc b/libheif/plugins/decoder_dav1d.cc index ca17da2c3c..19c01d6c1b 100644 --- a/libheif/plugins/decoder_dav1d.cc +++ b/libheif/plugins/decoder_dav1d.cc @@ -102,6 +102,7 @@ struct heif_error dav1d_new_decoder(void** dec) decoder->settings.all_layers = 0; if (dav1d_open(&decoder->context, &decoder->settings) != 0) { + delete decoder; struct heif_error err = {heif_error_Decoder_plugin_error, heif_suberror_Unspecified, kSuccess}; return err; }