Skip to content

Commit

Permalink
workaround for gcc compiler bug (#1421)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Feb 28, 2025
1 parent 803b8f5 commit 7647ea3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libheif/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1024,8 +1024,10 @@ Error HeifFile::set_item_data(const std::shared_ptr<Box_infe>& item, const uint8
else {
// uncompressed data, plain copy

data_array.resize(size);
memcpy(data_array.data(), data, size);
if (size > 0) { // Note: this 'if' is not necessary, but a workaround to a compiler bug (https://github.com/strukturag/libheif/issues/1421)
data_array.resize(size);
memcpy(data_array.data(), data, size);
}
}

// copy the data into the file, store the pointer to it in an iloc box entry
Expand Down

0 comments on commit 7647ea3

Please sign in to comment.