Skip to content

Commit 17d7e75

Browse files
committed
fix a /0 in frame parse
Thanks voidz0r See #83
1 parent e0f07cf commit 17d7e75

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* fix docs build with LLVM != 14 [bgilbert]
66
* improve thread safety docs [mollyclaretechcyte]
77
* fix a double free error and clarify docs on pointer ownership [dtatsis]
8+
* fix a divide by zero error [voidz0r]
89

910
## 1.0.5, 9/10/23
1011

src/dicom-file.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ static bool get_frame_size(DcmError **error,
324324
!get_tag_int(error, metadata, "Rows", &height)) {
325325
return false;
326326
}
327+
if (width <= 0 || height <= 0) {
328+
dcm_error_set(error, DCM_ERROR_CODE_PARSE,
329+
"Frame read failed",
330+
"Value of 'Columns' or 'Rows' is out of range");
331+
return false;
332+
}
327333

328334
*frame_width = (uint32_t) width;
329335
*frame_height = (uint32_t) height;

0 commit comments

Comments
 (0)