lilliput icon indicating copy to clipboard operation
lilliput copied to clipboard

Unreachable code in thumbhash_encoder_create function

Open skidder opened this issue 1 year ago • 0 comments

The thumbhash_encoder_create function includes a null-check on the return value from new; however, if new were to fail, the default behavior is to throw an std::bad_alloc exception rather than return null, making the if-condition unreachable.

https://github.com/discord/lilliput/blob/217a9d5cff47a3310851f1f9239df962c5b2c1bd/thumbhash.cpp#L18-L21

skidder avatar Aug 10 '23 18:08 skidder