This is an automated email from the git hooks/post-receive script. gert-guest pushed a commit to branch master in repository gdcm.
commit dc5472b29925ddfb5d1224632f27074e81e63223 Author: Gert Wollny <[email protected]> Date: Sat Jan 30 21:06:50 2016 +0100 New upstream version --- debian/changelog | 7 ++++ .../06_dcm_group2_buggyfiles_fallback.patch | 44 ++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 52 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3085dd8..9859e8b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +gdcm (2.6.3-1) UNRELEASED; urgency=medium + + * New upstream version + * Add patch 06 to tolerate buggy dicom files. Related: #753809 + + -- Gert Wollny <[email protected]> Sat, 30 Jan 2016 21:01:54 +0100 + gdcm (2.6.2-3) unstable; urgency=medium * d/control: Add dependency on php5-common for php5-* Closes: #810668 diff --git a/debian/patches/06_dcm_group2_buggyfiles_fallback.patch b/debian/patches/06_dcm_group2_buggyfiles_fallback.patch new file mode 100644 index 0000000..403b8c8 --- /dev/null +++ b/debian/patches/06_dcm_group2_buggyfiles_fallback.patch @@ -0,0 +1,44 @@ +--- a/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx ++++ b/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx +@@ -526,6 +526,7 @@ + //ExplicitAttribute<0x0002,0x0000> metagl; + //metagl.Read(is); + ++ std::streampos start = is.tellg(); + // TODO: Can now load data from std::ios::cur to std::ios::cur + metagl.GetValue() + + ExplicitDataElement xde; +@@ -545,10 +546,35 @@ + //#endif + Insert( xde ); + // See PS 3.5, Data Element Structure With Explicit VR ++ try { ++ // GDCM is a hack, so let's read all possible group 2 element, until the last one ++ // and leave the group length value aside. + while( ReadExplicitDataElement<SwapperNoOp>(is, xde ) ) + { + Insert( xde ); + } ++ } ++ catch( std::exception & ex ) ++ { ++ // we've read a little bit too much. We are possibly in the case where an ++ // implicit dataelement with group 2 (technically impossible) was found ++ // (first dataelement). Let's start over again, but this time use group ++ // length as the sentinel for the last group 2 element: ++ is.seekg(start,std::ios::beg); ++ // Group Length: ++ ReadExplicitDataElement<SwapperNoOp>(is, xde ); ++ ++ Attribute<0x0002, 0x0000> filemetagrouplength; ++ filemetagrouplength.SetFromDataElement( xde ); ++ const unsigned int glen = filemetagrouplength.GetValue(); ++ ++ unsigned int cur_len = 0; ++ while( cur_len < glen && ReadExplicitDataElement<SwapperNoOp>(is, xde ) ) ++ { ++ Insert( xde ); ++ cur_len += xde.GetLength(); ++ } ++ } + diff --git a/debian/patches/series b/debian/patches/series index e6d1584..fe7970b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,4 @@ 03_linkvtkdoc.patch 04_multiarch.patch 05_add_global_doxydoc_target.patch +06_dcm_group2_buggyfiles_fallback.patch -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/gdcm.git _______________________________________________ debian-med-commit mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit
