Skip to content

Commit

Permalink
dcm4che/dcm4chee-arc-light#98: Decompression of JPEG Loss Less Multif…
Browse files Browse the repository at this point in the history
…rame Images with padded Data Fragments fails
  • Loading branch information
gunterze committed Apr 22, 2016
1 parent 758ca23 commit e839deb
Showing 1 changed file with 12 additions and 8 deletions.
Expand Up @@ -96,10 +96,15 @@ public boolean seekNextFrame() throws IOException {
if (endOfStream)
return false;

while (!endOfFrame()) {
seek(fragmEndPos-1);
super.read(); // ensure to read whole Data Fragment from DicomInputStream
if (frameEndPos >= 0) {
seek(frameEndPos);
flush();
} else {
while (!endOfFrame()) {
seek(fragmEndPos-1);
super.read(); // ensure to read wh ole Data Fragment from DicomInputStream
flush();
}
}
frameStartPos = streamPos;
frameEndPos = -1L;
Expand All @@ -125,12 +130,11 @@ private boolean endOfFrame() throws IOException {
if (streamPos < fragmEndPos)
return false;

frameEndPos = fragmEndPos;
if (!readItemHeader() || fragmStartWord == frameStartWord)
return true;
if (readItemHeader() && fragmStartWord != frameStartWord)
return false;

frameEndPos = -1L;
return false;
frameEndPos = streamPos;
return true;
}

}

0 comments on commit e839deb

Please sign in to comment.