servo / rust-stb-image

Rust bindings to the awesome stb_image library
Other
68 stars 34 forks source link

Fix incorrect vector size when forcing depth on ImageU8. #96

Closed obiwanus closed 3 years ago

obiwanus commented 3 years ago

stbi_load* functions report the depth that the loaded image would have had if it had not been forced. We must use the forced depth value when making a Vec from the raw buffer, otherwise we may either not use the whole buffer or overrun the buffer and crash.

mbrubeck commented 3 years ago

@bors-servo r+

Thanks!

bors-servo commented 3 years ago

:pushpin: Commit 2f15244 has been approved by mbrubeck

bors-servo commented 3 years ago

:hourglass: Testing commit 2f15244398af2c8d3c63dbe5a310d76be38e86e4 with merge c8e38abbb17ef98255e10e13473be3056620dd0c...

bors-servo commented 3 years ago

:sunny: Test successful - checks-travis Approved by: mbrubeck Pushing c8e38abbb17ef98255e10e13473be3056620dd0c to master...