mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
fix some warnings: down-cast and possibly-uninitialized variable
Change-Id: I5baf59bbcd5dcff69316b0601483ff5abe8e1454
This commit is contained in:
parent
0a7102ba60
commit
cd8c3ba78f
@ -74,8 +74,7 @@ static VP8StatusCode AllocateBuffer(WebPDecBuffer* const buffer) {
|
||||
if (!buffer->is_external_memory && buffer->private_memory == NULL) {
|
||||
uint8_t* output;
|
||||
int uv_stride = 0, a_stride = 0;
|
||||
int uv_size = 0;
|
||||
uint64_t a_size = 0, total_size;
|
||||
uint64_t 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.
|
||||
const int stride = w * kModeBpp[mode];
|
||||
@ -108,10 +107,10 @@ static VP8StatusCode AllocateBuffer(WebPDecBuffer* const buffer) {
|
||||
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;
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ static WEBP_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
|
||||
@ -308,7 +308,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
|
||||
|
@ -551,6 +551,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 };
|
||||
|
Loading…
Reference in New Issue
Block a user