Repository navigation
Commit 8e07bc7
Use delete[] to free new[]-allocated buffer in decodeJPEGIntoSurface
`Image::decodeJPEGIntoSurface` allocates a buffer with `new uint8_t[]`
and freed it with `free()` on the OOM error path — undefined behavior
in C++ (`new[]` and `free()` may use different allocators, and even
when they share one they may have different bookkeeping for the array
size header).
Every other deallocation of `new uint8_t[]` buffers in Image.cc uses
`delete[]` correctly; this is the only outlier. Caught by
`g++ -Wmismatched-new-delete`.
Fixes #25731 parent b915755 commit 8e07bc7
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
839 | 839 | | |
840 | 840 | | |
841 | 841 | | |
842 | | - | |
| 842 | + | |
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
| |||
0 commit comments