Skip to content

Commit

Permalink
fix memory leak when dav1d initialization fails
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 20, 2024
1 parent 3e66922 commit bb5f973
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libheif/plugins/decoder_dav1d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bb5f973

Please sign in to comment.