The ImageViewborrows from the image buffer in DecodeBarcodeParams -- the newly refactored code frees it too early.
To help prevent some of these issues in the future, we'll be a bit clearer that DecodeBarcodeParamsowns the buffer and actually free it in the destructor. Same with EncodeBarcodeParams and contents.
I've also disabled the copy/move constructors so we don't accidentally double free or free a nullptr.
The
ImageView
borrows from the image buffer inDecodeBarcodeParams
-- the newly refactored code frees it too early.To help prevent some of these issues in the future, we'll be a bit clearer that
DecodeBarcodeParams
owns the buffer and actually free it in the destructor. Same withEncodeBarcodeParams
andcontents
.I've also disabled the copy/move constructors so we don't accidentally double free or free a nullptr.