Commit 46592b2
committed
Upcast image stride to 64-bit when multiplying values.
Dimensions are limited to 16 bits which when multiplied together should
fit in a 32-bit number. But the stride is (for RGBA) 4 times one
dimension *and* both index and stride are signed (which is 31 bits), so
it can overflow and become negative. This makes any access to a high
enough index go to somewhere before the start of the buffer.
Fixes matplotlib#8558.1 parent f92e79c commit 46592b2
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | | - | |
86 | | - | |
| 85 | + | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
0 commit comments