Skip to content

Commit

Permalink
uncompressed: define some default values to prevent undefined behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Jun 26, 2024
1 parent 85381e5 commit 78f97e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions libheif/uncompressed_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,22 +215,22 @@ class Box_uncC : public FullBox
protected:
Error parse(BitstreamRange& range) override;

uint32_t m_profile;
uint32_t m_profile = 0; // not compliant to any profile

std::vector<Component> m_components;
uint8_t m_sampling_type;
uint8_t m_interleave_type;
uint8_t m_block_size;
bool m_components_little_endian;
bool m_block_pad_lsb;
bool m_block_little_endian;
bool m_block_reversed;
bool m_pad_unknown;
uint32_t m_pixel_size;
uint32_t m_row_align_size;
uint32_t m_tile_align_size;
uint32_t m_num_tile_cols;
uint32_t m_num_tile_rows;
uint8_t m_sampling_type = 0; // no subsampling
uint8_t m_interleave_type = 0; // component interleaving
uint8_t m_block_size = 0;
bool m_components_little_endian = true;
bool m_block_pad_lsb = false;
bool m_block_little_endian = true;
bool m_block_reversed = false;
bool m_pad_unknown = true;
uint32_t m_pixel_size = 0;
uint32_t m_row_align_size = 0;
uint32_t m_tile_align_size = 0;
uint32_t m_num_tile_cols = 0;
uint32_t m_num_tile_rows = 0;
};

#endif //LIBHEIF_UNCOMPRESSED_BOX_H
2 changes: 1 addition & 1 deletion libheif/uncompressed_image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ class AbstractDecoder
return dst_row_number * dst_plane_stride;
}

heif_channel channel;
heif_channel channel = heif_channel_Y;
uint8_t* dst_plane;
uint8_t* other_chroma_dst_plane;
int dst_plane_stride;
Expand Down

0 comments on commit 78f97e3

Please sign in to comment.