Commit ce848e5
committed
fix(pydicom): reject non-finite affine metadata in PydicomReader
Validate ImageOrientationPatient, ImagePositionPatient, PixelSpacing and
lastImagePositionPatient values with math.isfinite before building the affine
matrix, raising ValueError on NaN/inf instead of propagating corrupted geometry
(GHSA-6hp3-vr39-rqw8).
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>1 parent 7fe412b commit ce848e5
2 files changed
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
752 | 753 | | |
753 | 754 | | |
754 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
755 | 764 | | |
756 | 765 | | |
| 766 | + | |
| 767 | + | |
757 | 768 | | |
758 | 769 | | |
| 770 | + | |
| 771 | + | |
759 | 772 | | |
760 | 773 | | |
| 774 | + | |
| 775 | + | |
761 | 776 | | |
| 777 | + | |
| 778 | + | |
762 | 779 | | |
763 | 780 | | |
764 | 781 | | |
| |||
773 | 790 | | |
774 | 791 | | |
775 | 792 | | |
| 793 | + | |
| 794 | + | |
776 | 795 | | |
777 | 796 | | |
778 | 797 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
42 | 76 | | |
43 | 77 | | |
44 | 78 | | |
0 commit comments