mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-24 01:40:22 +02:00
Fix static analyzer warnings.
Change-Id: I45f0db2310b1188809963af93240e3d438f807b8
This commit is contained in:
@ -55,7 +55,7 @@ static int EncodeLossless(const uint8_t* const data, int width, int height,
|
||||
WebPConfig config;
|
||||
WebPPicture picture;
|
||||
|
||||
WebPPictureInit(&picture);
|
||||
if (!WebPPictureInit(&picture)) return 0;
|
||||
picture.width = width;
|
||||
picture.height = height;
|
||||
picture.use_argb = 1;
|
||||
|
@ -578,7 +578,7 @@ static uint64_t OneStatPass(VP8Encoder* const enc, VP8RDLevel rd_opt,
|
||||
uint64_t size = 0;
|
||||
uint64_t size_p0 = 0;
|
||||
uint64_t distortion = 0;
|
||||
const uint64_t pixel_count = nb_mbs * 384;
|
||||
const uint64_t pixel_count = (uint64_t)nb_mbs * 384;
|
||||
|
||||
VP8IteratorInit(enc, &it);
|
||||
SetLoopParams(enc, s->q);
|
||||
@ -789,7 +789,7 @@ int VP8EncTokenLoop(VP8Encoder* const enc) {
|
||||
VP8EncIterator it;
|
||||
VP8EncProba* const proba = &enc->proba_;
|
||||
const VP8RDLevel rd_opt = enc->rd_opt_level_;
|
||||
const uint64_t pixel_count = enc->mb_w_ * enc->mb_h_ * 384;
|
||||
const uint64_t pixel_count = (uint64_t)enc->mb_w_ * enc->mb_h_ * 384;
|
||||
PassStats stats;
|
||||
int ok;
|
||||
|
||||
|
@ -1181,7 +1181,7 @@ int VP8LGetHistoImageSymbols(int xsize, int ysize,
|
||||
const int entropy_combine_num_bins = low_effort ? NUM_PARTITIONS : BIN_SIZE;
|
||||
int entropy_combine;
|
||||
uint16_t* const map_tmp =
|
||||
WebPSafeMalloc(2 * image_histo_raw_size, sizeof(map_tmp));
|
||||
WebPSafeMalloc(2 * image_histo_raw_size, sizeof(*map_tmp));
|
||||
uint16_t* const cluster_mappings = map_tmp + image_histo_raw_size;
|
||||
int num_used = image_histo_raw_size;
|
||||
if (orig_histo == NULL || map_tmp == NULL) {
|
||||
|
@ -1192,7 +1192,7 @@ static void ClearTransformBuffer(VP8LEncoder* const enc) {
|
||||
// enc->use_predict_, enc->use_cross_color_
|
||||
static int AllocateTransformBuffer(VP8LEncoder* const enc, int width,
|
||||
int height) {
|
||||
const uint64_t image_size = width * height;
|
||||
const uint64_t image_size = (uint64_t)width * height;
|
||||
// VP8LResidualImage needs room for 2 scanlines of uint32 pixels with an extra
|
||||
// pixel in each, plus 2 regular scanlines of bytes.
|
||||
// TODO(skal): Clean up by using arithmetic in bytes instead of words.
|
||||
@ -1202,7 +1202,7 @@ static int AllocateTransformBuffer(VP8LEncoder* const enc, int width,
|
||||
: 0;
|
||||
const uint64_t transform_data_size =
|
||||
(enc->use_predict_ || enc->use_cross_color_)
|
||||
? VP8LSubSampleSize(width, enc->transform_bits_) *
|
||||
? (uint64_t)VP8LSubSampleSize(width, enc->transform_bits_) *
|
||||
VP8LSubSampleSize(height, enc->transform_bits_)
|
||||
: 0;
|
||||
const uint64_t max_alignment_in_words =
|
||||
|
Reference in New Issue
Block a user