dropbox / lepton

Lepton is a tool and file format for losslessly compressing JPEGs by an average of 22%.
https://blogs.dropbox.com/tech/2016/07/lepton-image-compression-saving-22-losslessly-from-images-at-15mbs/
Apache License 2.0
5.01k stars 355 forks source link

src/lepton/vp8_decoder.cc: PVS-Studio: bad initialization #88

Closed SviatoslavRazmyslov closed 7 years ago

SviatoslavRazmyslov commented 7 years ago

We have found and fixed a bug using PVS-Studio tool. PVS-Studio is a static code analyzer for C, C++ and C#: https://www.viva64.com/en/pvs-studio/

We suggests having a look at the emails, sent from @pvs-studio.com.

Analyzer warning: V656 Variables are initialized through the call to the same function. It's probably an error or un-optimized code. Consider inspecting the 'threadhandoff.back().luma_y_end' expression. Check lines: 221, 222. vp8_decoder.cc 222

danielrh commented 7 years ago

This appears to be a place where the code does the right thing, but it looks to be a typo. In this situation we have more threads than work units. So we set all extra threads to work on the last 0 rows at the end of the file (hence starting from end and ending at end) I'll add a comment to the code