Skip to content

Commit

Permalink
again fix the error that I just reintroduced (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Mar 30, 2023
1 parent be16fc6 commit 4fd2582
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions libheif/plugins/heif_encoder_aom.cc
Expand Up @@ -1004,6 +1004,11 @@ struct heif_error aom_encode_image(void* encoder_raw, const struct heif_image* i
0, // only encoding a single frame
1,
0); // no flags

// Note: we are freeing the input image directly after use.
// This covers the usual success case and also all error cases that occur below.
aom_img_free(&input_image);

if (res != AOM_CODEC_OK) {
err = {
heif_error_Encoder_plugin_error,
Expand All @@ -1014,15 +1019,6 @@ struct heif_error aom_encode_image(void* encoder_raw, const struct heif_image* i
return err;
}


// Note: we are freeing the input image directly after use.
// This covers the usual success case and also all error cases that occur below.
aom_img_free(&input_image);

if (err.code != heif_error_Ok) {
return err;
}

encoder->compressedData.clear();
const aom_codec_cx_pkt_t* pkt = NULL;
aom_codec_iter_t iter = NULL; // for extracting the compressed packets
Expand Down

0 comments on commit 4fd2582

Please sign in to comment.