mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-16 13:59:51 +02:00
fix multiple allocation for transform buffer
We were not updating the current_width_, which is usually not a problem, unless we use Delta Palette with small number of colors -> Addressed this re-entrancy problem by checking we have enough capacity for transform buffer. The problem is not currently visible, until we restrict the number of gradient used in delta-palette to less than 16. Then the buffers have different current_width_ and the problem surfaces. Change-Id: Icd84b919905d7789014bb6668bfb6813c93fb36e
This commit is contained in:
@ -32,6 +32,9 @@ typedef struct {
|
||||
uint32_t* argb_scratch_; // Scratch memory for argb rows
|
||||
// (used for prediction).
|
||||
uint32_t* transform_data_; // Scratch memory for transform data.
|
||||
uint32_t* transform_mem_; // Currently allocated memory.
|
||||
size_t transform_mem_size_; // Currently allocated memory size.
|
||||
|
||||
int current_width_; // Corresponds to packed image width.
|
||||
|
||||
// Encoding parameters derived from quality parameter.
|
||||
|
Reference in New Issue
Block a user