Bodmer / JPEGDecoder

A JPEG decoder library
Other
220 stars 64 forks source link

Probably wrong memset #24

Closed HumamHelfawi closed 6 years ago

HumamHelfawi commented 6 years ago

https://github.com/Bodmer/JPEGDecoder/blob/628752b7b937074ff6960ab7c57c3a8f0a5d59ae/src/JPEGDecoder.cpp#L437

I was wondering if this line should be:

memset(pImage , 0 , image_info.m_MCUWidth * image_info.m_MCUHeight * sizeof(*pImage))

Thanks!

Bodmer commented 6 years ago

Thanks, fixed this and associated latent bugs. In practice clearing the array is not necessary.