Skip to content

Commit 73b1367

Browse files
committed
Fix crash reading truncated metadata
1 parent 955d5c9 commit 73b1367

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/dicom-file.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,9 @@ const DcmDataSet *dcm_filehandle_get_metadata_subset(DcmError **error,
821821
DcmDataSet *meta = dcm_filehandle_read_metadata(error,
822822
filehandle,
823823
stop_tags);
824+
if (meta == NULL) {
825+
return NULL;
826+
}
824827

825828
// record the position of the tag that stopped the read
826829
if (!dcm_offset(error, filehandle, &filehandle->after_read_metadata)) {

0 commit comments

Comments
 (0)