Skip to content

Commit

Permalink
Update for compatibility with libx265 4.0
Browse files Browse the repository at this point in the history
libx265 4.0 has changed the signature of `x265_api::encoder_encode` and
`x265_encoder_encode` functions to accept a pointer to an array of
pointers to output pictures. That pointer is now required to be non-null,
otherwise the encode call crashes.

Upstream bug report: https://bitbucket.org/multicoreware/x265_git/issues/952/crash-in-libheif-tests
  • Loading branch information
Lastique committed Sep 15, 2024
1 parent 8034ec8 commit 96c3080
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libheif/plugins/encoder_x265.cc
Original file line number Diff line number Diff line change
Expand Up @@ -901,11 +901,20 @@ static struct heif_error x265_encode_image(void* encoder_raw, const struct heif_

encoder->encoder = api->encoder_open(param);

#if X265_BUILD >= 212
x265_picture* out_pic = NULL;
api->encoder_encode(encoder->encoder,
&encoder->nals,
&encoder->num_nals,
pic,
&out_pic);
#else
api->encoder_encode(encoder->encoder,
&encoder->nals,
&encoder->num_nals,
pic,
NULL);
#endif

api->picture_free(pic);
api->param_free(param);
Expand Down

0 comments on commit 96c3080

Please sign in to comment.