summaryrefslogtreecommitdiffstats
path: root/third_party/libwebp
diff options
context:
space:
mode:
authorfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-19 17:05:41 +0000
committerfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-19 17:05:41 +0000
commit021f9a401f17234425ae523b0743fedfd1b10b8c (patch)
tree996348bb2168fc46e17cca092d6adea84b43d9e7 /third_party/libwebp
parent48e9dfe6c8c14da48fd2145d157aebd934de2c3e (diff)
downloadchromium_src-021f9a401f17234425ae523b0743fedfd1b10b8c.zip
chromium_src-021f9a401f17234425ae523b0743fedfd1b10b8c.tar.gz
chromium_src-021f9a401f17234425ae523b0743fedfd1b10b8c.tar.bz2
fixes for warnings on Visual C /W4 for casting to wrong type and potentially uninitialized variables.
BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9700091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127490 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libwebp')
-rw-r--r--third_party/libwebp/README.chromium1
-rw-r--r--third_party/libwebp/dec/buffer.c13
-rw-r--r--third_party/libwebp/dec/io.c4
-rw-r--r--third_party/libwebp/dec/vp8.c2
4 files changed, 10 insertions, 10 deletions
diff --git a/third_party/libwebp/README.chromium b/third_party/libwebp/README.chromium
index b3c2b2b..758051a 100644
--- a/third_party/libwebp/README.chromium
+++ b/third_party/libwebp/README.chromium
@@ -16,6 +16,7 @@ developers can use WebP to compress, archive and distribute digital images more
efficiently.
Local changes:
+ * Fix cast and initialization warnings
* Removed from types.h the risky: #ifdef ANSI / #define inline /#endif
* Removed examples/, documentation and build related files, keeping only
the contents of src/.
diff --git a/third_party/libwebp/dec/buffer.c b/third_party/libwebp/dec/buffer.c
index 5de5e6f..a190f1f 100644
--- a/third_party/libwebp/dec/buffer.c
+++ b/third_party/libwebp/dec/buffer.c
@@ -65,8 +65,7 @@ static VP8StatusCode AllocateBuffer(WebPDecBuffer* const buffer) {
WEBP_CSP_MODE mode = buffer->colorspace;
int stride;
int uv_stride = 0, a_stride = 0;
- int uv_size = 0;
- uint64_t size, a_size = 0, total_size;
+ uint64_t size, uv_size = 0, a_size = 0, total_size;
// We need memory and it hasn't been allocated yet.
// => initialize output buffer, now that dimensions are known.
stride = w * kModeBpp[mode];
@@ -96,23 +95,23 @@ static VP8StatusCode AllocateBuffer(WebPDecBuffer* const buffer) {
WebPYUVABuffer* const buf = &buffer->u.YUVA;
buf->y = output;
buf->y_stride = stride;
- buf->y_size = size;
+ buf->y_size = (int)size;
buf->u = output + size;
buf->u_stride = uv_stride;
- buf->u_size = uv_size;
+ buf->u_size = (int)uv_size;
buf->v = output + size + uv_size;
buf->v_stride = uv_stride;
- buf->v_size = uv_size;
+ buf->v_size = (int)uv_size;
if (mode == MODE_YUVA) {
buf->a = output + size + 2 * uv_size;
}
- buf->a_size = a_size;
+ buf->a_size = (int)a_size;
buf->a_stride = a_stride;
} else { // RGBA initialization
WebPRGBABuffer* const buf = &buffer->u.RGBA;
buf->rgba = output;
buf->stride = stride;
- buf->size = size;
+ buf->size = (int)size;
}
}
return CheckDecBuffer(buffer);
diff --git a/third_party/libwebp/dec/io.c b/third_party/libwebp/dec/io.c
index 405df3a..ee6f352 100644
--- a/third_party/libwebp/dec/io.c
+++ b/third_party/libwebp/dec/io.c
@@ -256,7 +256,7 @@ static inline void ImportRow(const uint8_t* const src,
const int32_t frac = base * (-accum);
wrk->frow[x_out] = (sum + base) * wrk->x_sub - frac;
// fresh fractional start for next pixel
- sum = MULT(frac, wrk->fx_scale);
+ sum = (int)MULT(frac, wrk->fx_scale);
}
}
} else { // simple bilinear interpolation
@@ -282,7 +282,7 @@ static void ExportRow(WebPRescaler* const wrk) {
const int yscale = wrk->fy_scale * (-wrk->y_accum);
assert(wrk->y_accum <= 0);
for (x_out = 0; x_out < wrk->dst_width; ++x_out) {
- const int frac = MULT(wrk->frow[x_out], yscale);
+ const int frac = (int)MULT(wrk->frow[x_out], yscale);
const int v = (int)MULT(wrk->irow[x_out] - frac, wrk->fxy_scale);
wrk->dst[x_out] = (!(v & ~0xff)) ? v : (v < 0) ? 0 : 255;
wrk->irow[x_out] = frac; // new fractional start
diff --git a/third_party/libwebp/dec/vp8.c b/third_party/libwebp/dec/vp8.c
index af163fc..763a4bb 100644
--- a/third_party/libwebp/dec/vp8.c
+++ b/third_party/libwebp/dec/vp8.c
@@ -46,7 +46,6 @@ VP8Decoder* VP8New(void) {
SetOk(dec);
WebPWorkerInit(&dec->worker_);
dec->ready_ = 0;
- dec->num_parts_ = 1;
}
return dec;
}
@@ -557,6 +556,7 @@ static void ParseResiduals(VP8Decoder* const dec,
uint32_t non_zero_dc = 0;
int x, y, ch;
+ nz_dc.i32 = nz_ac.i32 = 0;
memset(dst, 0, 384 * sizeof(*dst));
if (!dec->is_i4x4_) { // parse DC
int16_t dc[16] = { 0 };