diff options
author | Ram Mohan M <ram.mohan@ittiam.com> | 2024-03-30 19:16:51 +0530 |
---|---|---|
committer | DichenZhang1 <140119224+DichenZhang1@users.noreply.github.com> | 2024-03-30 10:44:48 -0700 |
commit | 32887586e65c344bd007bc0827e78e570d4de309 (patch) | |
tree | 9b76556c267e4bf723a13cb689ad63295fb0855f | |
parent | 5541c377e8a7ffdc3a4337bf1964e300416218a3 (diff) | |
download | libultrahdr-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.cpp | 2 |
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, |