Commit e8354e1
committed
Create replacement DFD before mutating texture in HDR 4x4 relabel path
The UASTC HDR 4x4 to ASTC HDR 4x4 early exit in
ktxTexture2_TranscodeBasis freed the texture's DFD and relabelled
vkFormat before calling vk2dfd(). If vk2dfd() returned NULL the
function returned an error while leaving the texture with a freed pDfd
and an already-changed vkFormat. Allocate the replacement DFD first and
only then modify the texture, so failure leaves it untouched.
No behavior change on the success path.1 parent 02f39de commit e8354e1
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
206 | 212 | | |
207 | 213 | | |
| 214 | + | |
208 | 215 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | 216 | | |
213 | 217 | | |
214 | 218 | | |
| |||
0 commit comments