Skip to content

Commit

Permalink
Avoid overflowing operand before assignment in ZMBV
Browse files Browse the repository at this point in the history
Fixes LGTM warning:

  Multiplication result may overflow 'int' before it is
  converted to 'FrameBlock_offset'.
  • Loading branch information
kcgen committed Nov 28, 2021
1 parent 50357d2 commit dae32f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/zmbv/zmbv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ bool VideoCodec::SetupBuffers(const ZMBV_FORMAT _format, const int blockwidth, c
const auto yleft = height % blockheight;
if (yleft)
yblocks++;
blockcount = yblocks * xblocks;
blockcount = static_cast<FrameBlock_offset>(yblocks) * xblocks;
blocks.resize(blockcount);

size_t i = 0;
Expand Down

0 comments on commit dae32f6

Please sign in to comment.