mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
fix MSVC compile for WEBP_EXPERIMENTAL_FEATURES
patch by Ismail Keskin (iskeskin at gmail dot com) fixes issue #82
This commit is contained in:
parent
40a7e347ff
commit
3be57b166f
@ -23,6 +23,8 @@ extern "C" {
|
||||
|
||||
#ifdef WEBP_EXPERIMENTAL_FEATURES
|
||||
|
||||
#define CHUNK_SIZE 8192
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static int CompressAlpha(const uint8_t* data, size_t data_size,
|
||||
@ -30,7 +32,6 @@ static int CompressAlpha(const uint8_t* data, size_t data_size,
|
||||
int algo) {
|
||||
int ret = Z_OK;
|
||||
z_stream strm;
|
||||
const int CHUNK_SIZE = 8192;
|
||||
unsigned char chunk[CHUNK_SIZE];
|
||||
|
||||
*output = NULL;
|
||||
|
@ -158,6 +158,8 @@ static int EmitPartitionsSize(const VP8Encoder* const enc,
|
||||
|
||||
#ifdef WEBP_EXPERIMENTAL_FEATURES
|
||||
|
||||
#define KTRAILER_SIZE 8
|
||||
|
||||
static void PutLE24(uint8_t* buf, size_t value) {
|
||||
buf[0] = (value >> 0) & 0xff;
|
||||
buf[1] = (value >> 8) & 0xff;
|
||||
@ -165,8 +167,7 @@ static void PutLE24(uint8_t* buf, size_t value) {
|
||||
}
|
||||
|
||||
static int WriteExtensions(VP8Encoder* const enc) {
|
||||
const int kTrailerSize = 8;
|
||||
uint8_t buffer[kTrailerSize];
|
||||
uint8_t buffer[KTRAILER_SIZE];
|
||||
VP8BitWriter* const bw = &enc->bw_;
|
||||
WebPPicture* const pic = enc->pic_;
|
||||
|
||||
@ -190,8 +191,8 @@ static int WriteExtensions(VP8Encoder* const enc) {
|
||||
}
|
||||
}
|
||||
|
||||
buffer[kTrailerSize - 1] = 0x01; // marker
|
||||
if (!VP8BitWriterAppend(bw, buffer, kTrailerSize)) {
|
||||
buffer[KTRAILER_SIZE - 1] = 0x01; // marker
|
||||
if (!VP8BitWriterAppend(bw, buffer, KTRAILER_SIZE)) {
|
||||
return WebPEncodingSetError(pic, VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY);
|
||||
}
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user