Update ImageReaderSource.cpp
Removing memory leak in Ref<LuminanceSource> ImageReaderSource::create(string const& filename).
This commit is contained in:
parent
bc1f054246
commit
f41221926b
@ -75,6 +75,7 @@ Ref<LuminanceSource> ImageReaderSource::create(string const& filename) {
|
|||||||
char *buffer = reinterpret_cast<char*>(jpgd::decompress_jpeg_image_from_file(
|
char *buffer = reinterpret_cast<char*>(jpgd::decompress_jpeg_image_from_file(
|
||||||
filename.c_str(), &width, &height, &comps, 4));
|
filename.c_str(), &width, &height, &comps, 4));
|
||||||
image = zxing::ArrayRef<char>(buffer, 4 * width * height);
|
image = zxing::ArrayRef<char>(buffer, 4 * width * height);
|
||||||
|
free(buffer);
|
||||||
}
|
}
|
||||||
if (!image) {
|
if (!image) {
|
||||||
ostringstream msg;
|
ostringstream msg;
|
||||||
|
Loading…
Reference in New Issue
Block a user