Closed voidz0r closed 7 months ago
I fixed this with https://github.com/ImagingDataCommons/libdicom/commit/17d7e756a4f57a22caa7f4d54b34adcef957cf68 and credited you in the changelog (I hope that's OK).
Thank you for the very clear bug report!
I did a little quick grepping and I couldn't see any similar /0 issues.
Looks good to me. Thanks for the mention in the changelog :)
Introduction
The issue comes whenever a zero value is passed to one of the width,height parameter of the tile.
https://github.com/ImagingDataCommons/libdicom/blob/345eda55428b04182233615afeaa10ce10a0cbe1/src/dicom-file.c#L335-L363
Debugging it with gdb shows the following:
With the value of width and frame_width set to 0.
This is possible by crafting a DCM file with the following byte sequences:
Impact
The application just crashes with no further consequence. This issue does not seem to affect related products such as openslide.
Solution
The solution would be to check if the provided values are different from zero, and returns an error whenever this happens.
Attached the payload:
floatpe.zip