aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRam Mohan <ram.mohan@ittiam.com>2024-03-30 19:38:06 +0530
committerDichenZhang1 <140119224+DichenZhang1@users.noreply.github.com>2024-03-30 10:45:05 -0700
commitd934c4dab6421b1dc5690e688afbba77ab634269 (patch)
tree8f1f204a348acbd1c840b61c94275a12badadeba
parent32887586e65c344bd007bc0827e78e570d4de309 (diff)
downloadlibultrahdr-d934c4dab6421b1dc5690e688afbba77ab634269.tar.gz
Update fuzzer according to the updates made to decodeJPEGR
Earlier the gainmap data is allocated by the library and shared externally. Now the decodeJPEGR function expects to receive the location to which the gainmap data needs to be written
-rw-r--r--fuzzer/ultrahdr_dec_fuzzer.cpp4
-rw-r--r--fuzzer/ultrahdr_enc_fuzzer.cpp4
2 files changed, 2 insertions, 6 deletions
diff --git a/fuzzer/ultrahdr_dec_fuzzer.cpp b/fuzzer/ultrahdr_dec_fuzzer.cpp
index 4adc942..9a1f179 100644
--- a/fuzzer/ultrahdr_dec_fuzzer.cpp
+++ b/fuzzer/ultrahdr_dec_fuzzer.cpp
@@ -56,11 +56,9 @@ void UltraHdrDecFuzzer::process() {
auto decodedRaw = std::make_unique<uint8_t[]>(outSize);
decodedJpegR.data = decodedRaw.get();
ultrahdr_metadata_struct metadata;
- jpegr_uncompressed_struct decodedGainMap{};
(void)jpegHdr.decodeJPEGR(&jpegImgR, &decodedJpegR,
mFdp.ConsumeFloatingPointInRange<float>(1.0, FLT_MAX), nullptr, of,
- &decodedGainMap, &metadata);
- if (decodedGainMap.data) free(decodedGainMap.data);
+ nullptr, &metadata);
}
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
diff --git a/fuzzer/ultrahdr_enc_fuzzer.cpp b/fuzzer/ultrahdr_enc_fuzzer.cpp
index ff749c7..88faae8 100644
--- a/fuzzer/ultrahdr_enc_fuzzer.cpp
+++ b/fuzzer/ultrahdr_enc_fuzzer.cpp
@@ -297,14 +297,12 @@ void UltraHdrEncFuzzer::process() {
auto decodedRaw = std::make_unique<uint8_t[]>(outSize);
decodedJpegR.data = decodedRaw.get();
ultrahdr_metadata_struct metadata;
- jpegr_uncompressed_struct decodedGainMap{};
status = jpegHdr.decodeJPEGR(&jpegImgR, &decodedJpegR,
mFdp.ConsumeFloatingPointInRange<float>(1.0, FLT_MAX), nullptr,
- of, &decodedGainMap, &metadata);
+ of, nullptr, &metadata);
if (status != JPEGR_NO_ERROR) {
ALOGE("encountered error during decoding %d", status);
}
- if (decodedGainMap.data) free(decodedGainMap.data);
} else {
ALOGE("encountered error during get jpeg info %d", status);
}