Skip to content

Commit

Permalink
fix a /0 in frame parse
Browse files Browse the repository at this point in the history
Thanks voidz0r

See #83
  • Loading branch information
jcupitt committed Feb 16, 2024
1 parent e0f07cf commit 17d7e75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* fix docs build with LLVM != 14 [bgilbert]
* improve thread safety docs [mollyclaretechcyte]
* fix a double free error and clarify docs on pointer ownership [dtatsis]
* fix a divide by zero error [voidz0r]

## 1.0.5, 9/10/23

Expand Down
6 changes: 6 additions & 0 deletions src/dicom-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ static bool get_frame_size(DcmError **error,
!get_tag_int(error, metadata, "Rows", &height)) {
return false;
}
if (width <= 0 || height <= 0) {
dcm_error_set(error, DCM_ERROR_CODE_PARSE,
"Frame read failed",
"Value of 'Columns' or 'Rows' is out of range");
return false;
}

*frame_width = (uint32_t) width;
*frame_height = (uint32_t) height;
Expand Down

0 comments on commit 17d7e75

Please sign in to comment.