Repository navigation
Commit fbac0f6
Fix memory leak in JPEG EXIF rotation (rotate90/rotate270)
The rotate90 and rotate270 lambdas in Image::rotatePixels allocate a
temporary 'unrotated' buffer via 'new uint8_t[n_bytes]' but never free
it. Every JPEG decoded with EXIF orientation 5, 6, 7, or 8 leaks the
full rotated pixel buffer (width * height * 4 bytes) on each loadImage
call.
For a 1200x1800 test image (recurser/exif-orientation-examples
Landscape_6.jpg, EXIF Orientation=6), 100 sequential loads leak 837 MiB
(~8.4 MiB/iter, matching width * height * 4 = 8,640,000 bytes exactly).
After this fix, RSS plateaus after the first ~10 iterations.
Fixes #25721 parent 8e07bc7 commit fbac0f6
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1406 | 1406 | | |
1407 | 1407 | | |
1408 | 1408 | | |
| 1409 | + | |
1409 | 1410 | | |
1410 | 1411 | | |
1411 | 1412 | | |
| |||
1422 | 1423 | | |
1423 | 1424 | | |
1424 | 1425 | | |
| 1426 | + | |
1425 | 1427 | | |
1426 | 1428 | | |
1427 | 1429 | | |
| |||
0 commit comments