[Bf-blender-cvs] [266a125b11c] master: Cleanup: use sizeof() for better readability

Campbell Barton noreply at git.blender.org
Fri Aug 12 04:22:26 CEST 2022


Commit: 266a125b11c664256c3674f3393894e039c806b6
Author: Campbell Barton
Date:   Fri Aug 12 12:21:32 2022 +1000
Branches: master
https://developer.blender.org/rB266a125b11c664256c3674f3393894e039c806b6

Cleanup: use sizeof() for better readability

===================================================================

M	source/blender/blendthumb/src/blendthumb_extract.cc

===================================================================

diff --git a/source/blender/blendthumb/src/blendthumb_extract.cc b/source/blender/blendthumb/src/blendthumb_extract.cc
index 163197c8b67..fff1242f2ce 100644
--- a/source/blender/blendthumb/src/blendthumb_extract.cc
+++ b/source/blender/blendthumb/src/blendthumb_extract.cc
@@ -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) {



More information about the Bf-blender-cvs mailing list