oozcitak / exiflibrary

A .Net Standard library for editing Exif metadata
MIT License
131 stars 48 forks source link

CRC table initialisation is not thread safe #106

Open ziriax opened 1 year ago

ziriax commented 1 year ago

The CRC32 class is not thread safe. It has a static member that is lazily initialized, but no locking is performed. This caused us random PNG files being rejected because of bogus invalid CRCs on chunk.

This is easily solved, either put the table init in a static constructor, or use Lazy<T>