Skip to content

Commit

Permalink
fix integer types
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 20, 2024
1 parent 65a2130 commit f2fd312
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libheif/api/libheif/heif_regions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libheif/codecs/uncompressed/decoder_abstract.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void AbstractDecoder::buildChannelList(std::shared_ptr<HeifPixelImage>& 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<uint64_t>(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);
Expand Down
4 changes: 2 additions & 2 deletions libheif/image-items/grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Result<std::shared_ptr<HeifPixelImage>> ImageItem_Grid::decode_full_grid_image(c

std::deque<tile_data> tiles;
if (get_context()->get_max_decoding_threads() > 0)
tiles.resize(grid.get_rows() * grid.get_columns());
tiles.resize(static_cast<size_t>(grid.get_rows()) * static_cast<size-t>(grid.get_columns()));

std::deque<std::future<Error> > errs;
#endif
Expand Down Expand Up @@ -635,7 +635,7 @@ Result<std::shared_ptr<ImageItem_Grid>> ImageItem_Grid::add_new_grid_item(HeifCo

// generate dummy grid item IDs (0)
std::vector<heif_item_id> tile_ids;
tile_ids.resize(tile_rows * tile_columns);
tile_ids.resize(static_cast<size_t>(tile_rows) * static_cast<size_t>(tile_columns));

// Connect tiles to grid
file->add_iref_reference(grid_id, fourcc("dimg"), tile_ids);
Expand Down

0 comments on commit f2fd312

Please sign in to comment.