1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
JUCE/modules/juce_graphics/images
reuk 0223e44ae7
Image: Keep track of contiguous buffer size to avoid heap buffer overflows
In CoreGraphicsPixelData::createImage, image data was copied from a
BitmapData created from the Image passed into the function.

The BitmapData instance didn't keep track of the size of the buffer it
pointed to, so the buffer size was computed by multiplying the
BitmapData height by its line stride. However, if the BitmapData pointed
to a subsection of an image, the `data` pointer might be offset from
the allocated region, and `data + lineStride * height` would point past
the end of the allocated region. Trying to read/copy this range would
cause a heap buffer overflow at the end of the range.

This change adjusts BitmapData so that it keeps track of the size of the
allocated region. Taking a subsection of an image should subtract the
data pointer offset from the size of the allocated region.
2022-02-23 10:56:09 +00:00
..
juce_Image.cpp Image: Keep track of contiguous buffer size to avoid heap buffer overflows 2022-02-23 10:56:09 +00:00
juce_Image.h Image: Keep track of contiguous buffer size to avoid heap buffer overflows 2022-02-23 10:56:09 +00:00
juce_ImageCache.cpp ImageCache: Avoid data race on impl when accessing cache from a background thread 2021-10-06 16:59:07 +01:00
juce_ImageCache.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_ImageConvolutionKernel.cpp Updated all license headers 2020-06-29 08:30:22 +01:00
juce_ImageConvolutionKernel.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_ImageFileFormat.cpp Updated all license headers 2020-06-29 08:30:22 +01:00
juce_ImageFileFormat.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_ScaledImage.h Fix some typos 2022-01-25 11:48:46 +00:00