From b524e3369c12167edf1de33aa8d63fe41c527acc Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 25 Nov 2013 20:45:53 -0800 Subject: [PATCH 1/4] ErrorStatusLossless: correct return type int -> VP8StatusCode Change-Id: I8a224a622e98d401a6e401047780fa6b25cb0ae4 --- src/dec/idec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dec/idec.c b/src/dec/idec.c index 78562e3e..f2e64ad4 100644 --- a/src/dec/idec.c +++ b/src/dec/idec.c @@ -484,7 +484,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; } From 46db28657242ecee386a68ff6bc17cd0a66eddf0 Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 25 Nov 2013 20:47:35 -0800 Subject: [PATCH 2/4] idec: add some missing casts Change-Id: I021a014f1f3a597f37ba8d9f4006c8cb4100723c --- src/dec/idec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dec/idec.c b/src/dec/idec.c index f2e64ad4..b4d705aa 100644 --- a/src/dec/idec.c +++ b/src/dec/idec.c @@ -619,11 +619,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_); From 617d93480e8901669f29116b5d9c478f40e5c407 Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 25 Nov 2013 20:48:13 -0800 Subject: [PATCH 3/4] enc/vp8l: add a missing cast Change-Id: I2c1800516eb4573ae2599866ace10017b865f23a --- src/enc/vp8l.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/enc/vp8l.c b/src/enc/vp8l.c index 6c53a1d8..2ce29a2a 100644 --- a/src/enc/vp8l.c +++ b/src/enc/vp8l.c @@ -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_, From 05aacf77c25fffebfbb03f82f147617dc6882eb1 Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 25 Nov 2013 20:53:15 -0800 Subject: [PATCH 4/4] mux: add some missing casts + fix a return value + fix a param type Change-Id: I8bb7a4dc4c76b11140f8693c909aeb10f660e6e5 --- src/mux/muxedit.c | 2 +- src/mux/muxinternal.c | 4 ++-- src/mux/muxread.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mux/muxedit.c b/src/mux/muxedit.c index 1a026b45..4834c9f3 100644 --- a/src/mux/muxedit.c +++ b/src/mux/muxedit.c @@ -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( diff --git a/src/mux/muxinternal.c b/src/mux/muxinternal.c index 0a620ec9..af44bdb9 100644 --- a/src/mux/muxinternal.c +++ b/src/mux/muxinternal.c @@ -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); diff --git a/src/mux/muxread.c b/src/mux/muxread.c index 39d07d43..3b414667 100644 --- a/src/mux/muxread.c +++ b/src/mux/muxread.c @@ -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; }