mirror of
https://github.com/webmproject/libwebp.git
synced 2025-08-29 07:12:05 +02:00
Merge "Add fbounds-safety annotations for VP8BitWriter
." into main
This commit is contained in:
@@ -52,7 +52,7 @@ static int BitWriterResize(VP8BitWriter* const bw, size_t extra_size) {
|
|||||||
WEBP_UNSAFE_MEMCPY(new_buf, bw->buf, bw->pos);
|
WEBP_UNSAFE_MEMCPY(new_buf, bw->buf, bw->pos);
|
||||||
}
|
}
|
||||||
WebPSafeFree(bw->buf);
|
WebPSafeFree(bw->buf);
|
||||||
bw->buf = new_buf;
|
bw->buf = WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(uint8_t*, new_buf, new_size);
|
||||||
bw->max_pos = new_size;
|
bw->max_pos = new_size;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,8 @@ struct VP8BitWriter {
|
|||||||
int32_t value;
|
int32_t value;
|
||||||
int run; // number of outstanding bits
|
int run; // number of outstanding bits
|
||||||
int nb_bits; // number of pending bits
|
int nb_bits; // number of pending bits
|
||||||
uint8_t* buf; // internal buffer. Re-allocated regularly. Not owned.
|
// internal buffer. Re-allocated regularly. Not owned.
|
||||||
|
uint8_t* WEBP_SIZED_BY_OR_NULL(max_pos) buf;
|
||||||
size_t pos;
|
size_t pos;
|
||||||
size_t max_pos;
|
size_t max_pos;
|
||||||
int error; // true in case of error
|
int error; // true in case of error
|
||||||
|
Reference in New Issue
Block a user