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; }