Skip to content

Commit

Permalink
kvazaar: ensure input pucture dimensions are divisible by 8
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthSim committed Nov 14, 2023
1 parent ce1e458 commit 8a7a150
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion libheif/plugins/encoder_kvazaar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,17 @@ static struct heif_error kvazaar_encode_image(void* encoder_raw, const struct he
}
*/

kvz_picture* pic = api->picture_alloc_csp(kvzChroma, config->width, config->height);
uint32_t pic_width = config->width;
if (pic_width % 8 != 0) {
pic_width += 8 - (pic_width % 8);
}

uint32_t pic_height = config->height;
if (pic_height % 8 != 0) {
pic_height += 8 - (pic_height % 8);
}

kvz_picture* pic = api->picture_alloc_csp(kvzChroma, pic_width, pic_height);
if (!pic) {
api->config_destroy(config);
return heif_error{
Expand Down

0 comments on commit 8a7a150

Please sign in to comment.