mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-18 23:09:52 +02:00
Fix static analyzer warnings.
Change-Id: I45f0db2310b1188809963af93240e3d438f807b8
This commit is contained in:
@ -593,16 +593,17 @@ int WebPAnimEncoderRefineRect(
|
||||
int is_lossless, float quality, int* const x_offset, int* const y_offset,
|
||||
int* const width, int* const height) {
|
||||
FrameRectangle rect;
|
||||
const int right = clip(*x_offset + *width, 0, curr_canvas->width);
|
||||
const int left = clip(*x_offset, 0, curr_canvas->width - 1);
|
||||
const int bottom = clip(*y_offset + *height, 0, curr_canvas->height);
|
||||
const int top = clip(*y_offset, 0, curr_canvas->height - 1);
|
||||
int right, left, bottom, top;
|
||||
if (prev_canvas == NULL || curr_canvas == NULL ||
|
||||
prev_canvas->width != curr_canvas->width ||
|
||||
prev_canvas->height != curr_canvas->height ||
|
||||
!prev_canvas->use_argb || !curr_canvas->use_argb) {
|
||||
return 0;
|
||||
}
|
||||
right = clip(*x_offset + *width, 0, curr_canvas->width);
|
||||
left = clip(*x_offset, 0, curr_canvas->width - 1);
|
||||
bottom = clip(*y_offset + *height, 0, curr_canvas->height);
|
||||
top = clip(*y_offset, 0, curr_canvas->height - 1);
|
||||
rect.x_offset_ = left;
|
||||
rect.y_offset_ = top;
|
||||
rect.width_ = clip(right - left, 0, curr_canvas->width - rect.x_offset_);
|
||||
|
@ -555,7 +555,8 @@ static WebPMuxError MuxCleanup(WebPMux* const mux) {
|
||||
if (num_frames == 1) {
|
||||
WebPMuxImage* frame = NULL;
|
||||
err = MuxImageGetNth((const WebPMuxImage**)&mux->images_, 1, &frame);
|
||||
assert(err == WEBP_MUX_OK); // We know that one frame does exist.
|
||||
if (err != WEBP_MUX_OK) return err;
|
||||
// We know that one frame does exist.
|
||||
assert(frame != NULL);
|
||||
if (frame->header_ != NULL &&
|
||||
((mux->canvas_width_ == 0 && mux->canvas_height_ == 0) ||
|
||||
|
Reference in New Issue
Block a user