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

[jpgcoder.cc] fix undefined behavior #76

Closed bryonglodencissp closed 7 years ago

bryonglodencissp commented 7 years ago

:bug: label: security

Greetings,

It's always good to initialize integer variables, at least to 0, because if we try to retrieve its value before it gets assigned any actual (non-garbage) value, then it results in undefined behavior, e.g. line number 2937 of lepton/src/lepton/jpgcoder.cc.

REF: http://cwe.mitre.org/data/definitions/457.html

Signed-off-by: Bryon Gloden, CISSP® cissp@bryongloden.com