Page MenuHome

Fix T99705: fix integer overflow in thumbnail extractor
ClosedPublic

Authored by Ray Molenkamp (LazyDodo) on Jul 14 2022, 6:54 PM.

Details

Summary

It's smart enough to check if the buffer is big enough, but
neglected to cast to a 64 bit value so it overflowed.

note that casting to size_t seems the obvious solution here
but that would not fix the overflow for 32 bit architectures.

Diff Detail

Repository
rB Blender
Branch
tmp_fix_thumb_int_overflow (branched from master)
Build Status
Buildable 22998
Build 22998: arc lint + arc unit

Event Timeline

Ray Molenkamp (LazyDodo) requested review of this revision.Jul 14 2022, 6:54 PM
Ray Molenkamp (LazyDodo) created this revision.

https://builder.blender.org/admin/#/builders/18/builds/536

doing a quick buildbot run just to make sure i didn't add any warns on linux/mac

If width and height are at their maximum value, multiplying by 4 can still make it overflow.

Good catch, uint64_t can contain it nicely though https://godbolt.org/z/GWTs7WYzf

  • Update with feedback
This revision is now accepted and ready to land.Jul 14 2022, 7:54 PM