From 53991e344c2c905d6ffd12f399f572d51f441af5 Mon Sep 17 00:00:00 2001 From: Nilesh Trimbake Date: Tue, 6 Nov 2018 12:46:19 +0530 Subject: [PATCH] Add valid pointer to image_util_decode_run() API This patch add valid pointer to image util api. Change-Id: I2fb8103d683a030c83b05720dc3afecea521b7fc --- src/Common/Utils/src/MediaUtils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Common/Utils/src/MediaUtils.cpp b/src/Common/Utils/src/MediaUtils.cpp index 8a58e231..68dd5964 100644 --- a/src/Common/Utils/src/MediaUtils.cpp +++ b/src/Common/Utils/src/MediaUtils.cpp @@ -219,6 +219,7 @@ long long MediaUtils::downgradeImageQuality(const std::string &imagePath) unsigned int exifBuffLen = 0; unsigned char *jpegBuff = nullptr; unsigned long long int jpegBuffLen = 0; + unsigned long long int bufferSize = 0; std::ofstream outputFile; exifData = exif_data_new_from_file(imagePath.c_str()); @@ -241,7 +242,7 @@ long long MediaUtils::downgradeImageQuality(const std::string &imagePath) return FileUtils::getFileSize(imagePath); } - res = image_util_decode_run(decode_h, &width, &height, nullptr); + res = image_util_decode_run(decode_h, &width, &height, &bufferSize); image_util_decode_destroy(decode_h); if (res != IMAGE_UTIL_ERROR_NONE) return FileUtils::getFileSize(imagePath); -- 2.34.1