Skip to content

Commit

Permalink
add comment why we free the input image early (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Mar 30, 2023
1 parent dbdc1e2 commit 49e3cbf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libheif/plugins/heif_encoder_aom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,11 @@ struct heif_error aom_encode_image(void* encoder_raw, const struct heif_image* i
// --- encode frame

err = encode_frame(encoder, &codec, &input_image); //, frame_count++, flags, writer);

// 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;
}
Expand Down

0 comments on commit 49e3cbf

Please sign in to comment.