[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. a206d93af7fe44b8e81356cafffdb60683
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: malat <ma...@us...> - 2025-05-26 09:03:25
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Grassroots DICOM".
The branch, release has been updated
via a206d93af7fe44b8e81356cafffdb606831554b6 (commit)
from b5e6900bd2a9c6b837f64382eab46403a7990f53 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceforge.net/p/gdcm/gdcm/ci/a206d93af7fe44b8e81356cafffdb606831554b6/
commit a206d93af7fe44b8e81356cafffdb606831554b6
Author: Bradley Lowekamp <blo...@ma...>
Date: Tue Apr 15 10:42:04 2025 -0400
BUG: Release jpeg2000 resources when error occours
Repeated attempted reading of DICOM files with unsupported JPEG2000
encoding can results is resource exhaustion. For example threads were
not being freed before when errors were encountered.
diff --git a/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx b/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx
index 027c72b50..41cb708b4 100644
--- a/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx
@@ -1487,7 +1487,8 @@ bool JPEG2000Codec::GetHeaderInfo(const char * dummy_buffer, size_t buf_size, Tr
&image) ? true : false;
if(!bResult)
{
- opj_stream_destroy(cio);
+ opj_destroy_codec(dinfo);
+ opj_stream_destroy(cio);
return false;
}
//image = opj_decode(dinfo, cio);
@@ -1530,6 +1531,8 @@ bool JPEG2000Codec::GetHeaderInfo(const char * dummy_buffer, size_t buf_size, Tr
if( !check_comp_valid( image ) )
{
+ opj_destroy_codec(dinfo);
+ opj_stream_destroy(cio);
gdcmErrorMacro( "Invalid test failed" );
return false;
}
@@ -1551,6 +1554,8 @@ bool JPEG2000Codec::GetHeaderInfo(const char * dummy_buffer, size_t buf_size, Tr
}
else
{
+ opj_destroy_codec(dinfo);
+ opj_stream_destroy(cio);
gdcmErrorMacro( "do not handle precision: " << comp->prec );
return false;
}
@@ -1603,6 +1608,8 @@ bool JPEG2000Codec::GetHeaderInfo(const char * dummy_buffer, size_t buf_size, Tr
}
else if( image->numcomps == 4 )
{
+ opj_destroy_codec(dinfo);
+ opj_stream_destroy(cio);
/* Yes this is legal */
// http://www.crc.ricoh.com/~gormish/jpeg2000conformance/
// jpeg2000testimages/Part4TestStreams/codestreams_profile0/p0_06.j2k
@@ -1612,6 +1619,8 @@ bool JPEG2000Codec::GetHeaderInfo(const char * dummy_buffer, size_t buf_size, Tr
}
else
{
+ opj_destroy_codec(dinfo);
+ opj_stream_destroy(cio);
// jpeg2000testimages/Part4TestStreams/codestreams_profile0/p0_13.j2k
gdcmErrorMacro( "Image is " << image->numcomps << " components which is not supported in DICOM" );
return false;
-----------------------------------------------------------------------
Summary of changes:
Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
hooks/post-receive
--
Grassroots DICOM
|