Cleanup: use sizeof() for better readability

This commit is contained in:
Campbell Barton 2022-08-12 12:21:32 +10:00
parent f145366ae0
commit 266a125b11
1 changed files with 1 additions and 1 deletions

View File

@ -136,7 +136,7 @@ static eThumbStatus blendthumb_extract_from_file_impl(FileReader *file,
thumb->height = bytes_to_native_i32(&shape[4], endian_switch);
/* Verify that image dimensions and data size make sense. */
size_t data_size = block_size - 8;
size_t data_size = block_size - sizeof(shape);
const uint64_t expected_size = static_cast<uint64_t>(thumb->width) *
static_cast<uint64_t>(thumb->height) * 4;
if (thumb->width < 0 || thumb->height < 0 || data_size != expected_size) {