mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 05:38:22 +01:00
Merge changes I8bb7a4dc,I2c180051,I021a014f,I8a224a62
* changes: mux: add some missing casts enc/vp8l: add a missing cast idec: add some missing casts ErrorStatusLossless: correct return type
This commit is contained in:
commit
cc55790e37
@ -485,7 +485,8 @@ static VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) {
|
||||
return VP8_STATUS_OK;
|
||||
}
|
||||
|
||||
static int ErrorStatusLossless(WebPIDecoder* const idec, VP8StatusCode status) {
|
||||
static VP8StatusCode ErrorStatusLossless(WebPIDecoder* const idec,
|
||||
VP8StatusCode status) {
|
||||
if (status == VP8_STATUS_SUSPENDED || status == VP8_STATUS_NOT_ENOUGH_DATA) {
|
||||
return VP8_STATUS_SUSPENDED;
|
||||
}
|
||||
@ -619,11 +620,11 @@ void WebPIDelete(WebPIDecoder* idec) {
|
||||
if (!idec->is_lossless_) {
|
||||
if (idec->state_ == STATE_VP8_DATA) {
|
||||
// Synchronize the thread, clean-up and check for errors.
|
||||
VP8ExitCritical(idec->dec_, &idec->io_);
|
||||
VP8ExitCritical((VP8Decoder*)idec->dec_, &idec->io_);
|
||||
}
|
||||
VP8Delete(idec->dec_);
|
||||
VP8Delete((VP8Decoder*)idec->dec_);
|
||||
} else {
|
||||
VP8LDelete(idec->dec_);
|
||||
VP8LDelete((VP8LDecoder*)idec->dec_);
|
||||
}
|
||||
}
|
||||
ClearMemBuffer(&idec->mem_);
|
||||
|
@ -892,7 +892,7 @@ static WebPEncodingError EncodePalette(VP8LBitWriter* const bw,
|
||||
if (err != VP8_ENC_OK) goto Error;
|
||||
dst = enc->argb_;
|
||||
|
||||
row = WebPSafeMalloc((uint64_t)width, sizeof(*row));
|
||||
row = (uint8_t*)WebPSafeMalloc((uint64_t)width, sizeof(*row));
|
||||
if (row == NULL) return VP8_ENC_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
ApplyPalette(src, dst, pic->argb_stride, enc->current_width_,
|
||||
|
@ -414,7 +414,7 @@ static WebPMuxError GetImageInfo(const WebPMuxImage* const wpi,
|
||||
// Get width and height from VP8/VP8L chunk.
|
||||
if (width != NULL) *width = wpi->width_;
|
||||
if (height != NULL) *height = wpi->height_;
|
||||
return 1;
|
||||
return WEBP_MUX_OK;
|
||||
}
|
||||
|
||||
static WebPMuxError GetImageCanvasWidthHeight(
|
||||
|
@ -70,7 +70,7 @@ WebPChunk* ChunkRelease(WebPChunk* const chunk) {
|
||||
CHUNK_INDEX ChunkGetIndexFromTag(uint32_t tag) {
|
||||
int i;
|
||||
for (i = 0; kChunks[i].tag != NIL_TAG; ++i) {
|
||||
if (tag == kChunks[i].tag) return i;
|
||||
if (tag == kChunks[i].tag) return (CHUNK_INDEX)i;
|
||||
}
|
||||
return IDX_UNKNOWN;
|
||||
}
|
||||
@ -451,7 +451,7 @@ static int IsNotCompatible(int feature, int num_items) {
|
||||
// On success returns WEBP_MUX_OK and stores the chunk count in *num.
|
||||
static WebPMuxError ValidateChunk(const WebPMux* const mux, CHUNK_INDEX idx,
|
||||
WebPFeatureFlags feature,
|
||||
WebPFeatureFlags vp8x_flags,
|
||||
uint32_t vp8x_flags,
|
||||
int max, int* num) {
|
||||
const WebPMuxError err =
|
||||
WebPMuxNumChunks(mux, kChunks[idx].id, num);
|
||||
|
@ -505,7 +505,7 @@ WebPMuxError WebPMuxGetAnimationParams(const WebPMux* mux,
|
||||
static CHUNK_INDEX ChunkGetIndexFromId(WebPChunkId id) {
|
||||
int i;
|
||||
for (i = 0; kChunks[i].id != WEBP_CHUNK_NIL; ++i) {
|
||||
if (id == kChunks[i].id) return i;
|
||||
if (id == kChunks[i].id) return (CHUNK_INDEX)i;
|
||||
}
|
||||
return IDX_NIL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user