aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRam Mohan M <ram.mohan@ittiam.com>2024-03-30 19:16:51 +0530
committerDichenZhang1 <140119224+DichenZhang1@users.noreply.github.com>2024-03-30 10:44:48 -0700
commit32887586e65c344bd007bc0827e78e570d4de309 (patch)
tree9b76556c267e4bf723a13cb689ad63295fb0855f
parent5541c377e8a7ffdc3a4337bf1964e300416218a3 (diff)
downloadlibultrahdr-32887586e65c344bd007bc0827e78e570d4de309.tar.gz
Fix issue in getJPEGRInfo()
If a valid jpeg image with no gainmap image is fed as input, the function is ignoring the error received and parse unassigned gainmap image structure causing seg fault
-rw-r--r--lib/src/jpegr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/src/jpegr.cpp b/lib/src/jpegr.cpp
index e9252c5..848eb96 100644
--- a/lib/src/jpegr.cpp
+++ b/lib/src/jpegr.cpp
@@ -612,7 +612,7 @@ status_t JpegR::getJPEGRInfo(jr_compressed_ptr jpegr_image_ptr, jr_info_ptr jpeg
jpegr_compressed_struct primary_image, gainmap_image;
status_t status = extractPrimaryImageAndGainMap(jpegr_image_ptr, &primary_image, &gainmap_image);
- if (status != JPEGR_NO_ERROR && status != ERROR_JPEGR_GAIN_MAP_IMAGE_NOT_FOUND) {
+ if (status != JPEGR_NO_ERROR) {
return status;
}
status = parseJpegInfo(&primary_image, jpegr_image_info_ptr->primaryImgInfo,