mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix deprecated libpng io_ptr direct access
This commit is contained in:
parent
8842197e6f
commit
0aa080e78e
@ -301,7 +301,7 @@ void PNGWriter::write_splash_bitmap(SplashBitmap *bitmap) {
|
|||||||
|
|
||||||
void calibre_png_mem_write(png_structp png_ptr, png_bytep data, png_size_t length) {
|
void calibre_png_mem_write(png_structp png_ptr, png_bytep data, png_size_t length) {
|
||||||
if (!png_ptr || length < 1) return;
|
if (!png_ptr || length < 1) return;
|
||||||
vector<char> *buf = static_cast< vector<char>* >(png_ptr->io_ptr);
|
vector<char> *buf = static_cast< vector<char>* >(png_get_io_ptr(png_ptr));
|
||||||
buf->reserve(buf->capacity() + length);
|
buf->reserve(buf->capacity() + length);
|
||||||
do {
|
do {
|
||||||
buf->push_back(static_cast<char>(*data));
|
buf->push_back(static_cast<char>(*data));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user