Skip to content

Commit

Permalink
unci: work around clang-tidy false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Sep 16, 2024
1 parent b118f04 commit ca2f520
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions libheif/codecs/uncompressed_image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,10 @@ class ComponentInterleaveDecoder : public AbstractDecoder
uint32_t image_width, uint32_t image_height,
uint32_t tile_x, uint32_t tile_y) override
{
if (m_tile_width == 0) {
return {heif_error_Decoder_plugin_error, heif_suberror_Unspecified, "Internal error: ComponentInterleaveDecoder tile_width=0"};
}

// --- compute which file range we need to read for the tile

uint64_t total_tile_size = 0;
Expand Down Expand Up @@ -935,6 +939,10 @@ class PixelInterleaveDecoder : public AbstractDecoder
uint32_t image_width, uint32_t image_height,
uint32_t tile_x, uint32_t tile_y) override
{
if (m_tile_width == 0) {
return {heif_error_Decoder_plugin_error, heif_suberror_Unspecified, "Internal error: PixelInterleaveDecoder tile_width=0"};
}

// --- compute which file range we need to read for the tile

uint32_t bits_per_row = 0;
Expand Down Expand Up @@ -1033,6 +1041,10 @@ class MixedInterleaveDecoder : public AbstractDecoder
uint32_t image_width, uint32_t image_height,
uint32_t tile_x, uint32_t tile_y) override
{
if (m_tile_width == 0) {
return {heif_error_Decoder_plugin_error, heif_suberror_Unspecified, "Internal error: MixedInterleaveDecoder tile_width=0"};
}

// --- compute which file range we need to read for the tile

uint64_t tile_size = 0;
Expand Down Expand Up @@ -1136,6 +1148,10 @@ class RowInterleaveDecoder : public AbstractDecoder
uint32_t image_width, uint32_t image_height,
uint32_t tile_x, uint32_t tile_y) override
{
if (m_tile_width == 0) {
return {heif_error_Decoder_plugin_error, heif_suberror_Unspecified, "Internal error: RowInterleaveDecoder tile_width=0"};
}

// --- compute which file range we need to read for the tile

uint32_t bits_per_row = 0;
Expand Down Expand Up @@ -1227,6 +1243,13 @@ class TileComponentInterleaveDecoder : public AbstractDecoder
uint32_t image_width, uint32_t image_height,
uint32_t tile_column, uint32_t tile_row) override
{
if (m_tile_width == 0) {
return {heif_error_Decoder_plugin_error, heif_suberror_Unspecified, "Internal error: TileComponentInterleaveDecoder tile_width=0"};
}
if (m_tile_height == 0) {
return {heif_error_Decoder_plugin_error, heif_suberror_Unspecified, "Internal error: TileComponentInterleaveDecoder tile_height=0"};
}

// --- compute which file range we need to read for the tile

std::map<heif_channel, uint64_t> channel_tile_size;
Expand Down

0 comments on commit ca2f520

Please sign in to comment.