Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer overrun when encapsulated pixel data SequenceDelimitationItem (FFFE,E0DD) has undefined length #266

Open
jmhmd opened this issue Mar 29, 2024 · 1 comment

Comments

@jmhmd
Copy link

jmhmd commented Mar 29, 2024

I have some test files which I think are non-compliant, but wondering if dicomParser's handling is optimal. These files have encapsulated pixel data with one defined length item containing the pixel data stream. However, it appears that the pixel data sequence delimitation item (FFFE,E0DD) has length = 4294967295 (undefined), rather than 0. I believe a length of 0 is required per the standard: https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_7.5.2.html

dicomParser, however, takes whatever length is given and tries to seek to that position, which results in a buffer overrun error being thrown. Why doesn't dicomParser just assume a length of 0 for the FFFE,E0DD element as required by the standard? Relevant code here:

if (tag === 'xfffee0dd') {

Example file: https://drive.google.com/file/d/1tqXGAdfSq3H4oJA_w_dbhWJG2JrPapEx/view?usp=sharing

@jmhmd
Copy link
Author

jmhmd commented Mar 29, 2024

Running the file through dcmtk dcmconv without any options appears to correctly re-encode the file, and dicomParser parses without error. Here is the fixed file: https://drive.google.com/file/d/1-i64W77GhN7oLGK2CzO_MoD0xnCRmMFZ/view?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant