There have been several issues that mention EOF errors. (e.g. #62) This PR fixes an error that manifested itself with an EOF error, so it may address those.
The problem occurs when there is an odd number of bytes in the pixel data, and even though the value length is even, the parser doesn't count the last padding byte.
Regarding the implementation, it might be more robust to skip ahead the difference between vl and bytesRead in readNativeFrames, but my understanding of this library and the DICOM standard is that the difference will always be 0 or 1.
There have been several issues that mention EOF errors. (e.g. #62) This PR fixes an error that manifested itself with an EOF error, so it may address those.
The problem occurs when there is an odd number of bytes in the pixel data, and even though the value length is even, the parser doesn't count the last padding byte.
Regarding the implementation, it might be more robust to skip ahead the difference between
vl
andbytesRead
inreadNativeFrames
, but my understanding of this library and the DICOM standard is that the difference will always be 0 or 1.