Commit 657af9c
committed
avifImageCopy: check avifImageCreateEmpty() result for gain map image
When the destination image has no gain map image yet but the source does,
avifImageCopy() called avifImageCreateEmpty() and passed the result to a
recursive avifImageCopy() without checking for allocation failure. Under
out-of-memory conditions this dereferenced a NULL pointer in
avifImageFreePlanes() at the start of the recursive call.
Add the missing AVIF_CHECKERR, matching the existing pattern used for the
avifGainMapCreate() allocation a few lines above.1 parent 3c66271 commit 657af9c
2 files changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
308 | 309 | | |
309 | 310 | | |
310 | 311 | | |
| |||
0 commit comments