diff --git a/libheif/api/libheif/heif_regions.cc b/libheif/api/libheif/heif_regions.cc index 2d26f2fb0d..a7f98dac7d 100644 --- a/libheif/api/libheif/heif_regions.cc +++ b/libheif/api/libheif/heif_regions.cc @@ -333,8 +333,8 @@ struct heif_error heif_region_item_add_region_inline_mask(struct heif_region_ite region->mask_data.resize((width * height + 7) / 8); memset(region->mask_data.data(), 0, region->mask_data.size()); - uint32_t mask_height = (uint32_t)heif_image_get_height(mask_image, heif_channel_Y); - uint32_t mask_width = (uint32_t)heif_image_get_width(mask_image, heif_channel_Y); + uint32_t mask_height = mask_image->image->get_height(); + uint32_t mask_width = mask_image->image->get_width(); int stride; uint8_t* p = heif_image_get_plane(mask_image, heif_channel_Y, &stride); uint64_t pixel_index = 0; diff --git a/libheif/codecs/uncompressed/decoder_abstract.cc b/libheif/codecs/uncompressed/decoder_abstract.cc index 7b66edbcd4..d858f4028a 100644 --- a/libheif/codecs/uncompressed/decoder_abstract.cc +++ b/libheif/codecs/uncompressed/decoder_abstract.cc @@ -58,7 +58,7 @@ void AbstractDecoder::buildChannelList(std::shared_ptr& img) void AbstractDecoder::processComponentSample(UncompressedBitReader& srcBits, const ChannelListEntry& entry, uint64_t dst_row_offset, uint32_t tile_column, uint32_t tile_x) { - uint64_t dst_col_number = tile_column * entry.tile_width + tile_x; + uint64_t dst_col_number = static_cast(tile_column) * entry.tile_width + tile_x; uint64_t dst_column_offset = dst_col_number * entry.bytes_per_component_sample; int val = srcBits.get_bits(entry.bits_per_component_sample); memcpy(entry.dst_plane + dst_row_offset + dst_column_offset, &val, entry.bytes_per_component_sample); diff --git a/libheif/image-items/grid.cc b/libheif/image-items/grid.cc index d4e50a61e7..579136050d 100644 --- a/libheif/image-items/grid.cc +++ b/libheif/image-items/grid.cc @@ -266,7 +266,7 @@ Result> ImageItem_Grid::decode_full_grid_image(c std::deque tiles; if (get_context()->get_max_decoding_threads() > 0) - tiles.resize(grid.get_rows() * grid.get_columns()); + tiles.resize(static_cast(grid.get_rows()) * static_cast(grid.get_columns())); std::deque > errs; #endif @@ -635,7 +635,7 @@ Result> ImageItem_Grid::add_new_grid_item(HeifCo // generate dummy grid item IDs (0) std::vector tile_ids; - tile_ids.resize(tile_rows * tile_columns); + tile_ids.resize(static_cast(tile_rows) * static_cast(tile_columns)); // Connect tiles to grid file->add_iref_reference(grid_id, fourcc("dimg"), tile_ids);