Merge changes If628bb93,Ic79f6309,I45f0db23 into main

* changes:
  Update lossless spec for two simple codes.
  Fix non-C90 code.
  Fix static analyzer warnings.
This commit is contained in:
Vincent Rabaud
2023-09-15 06:44:42 +00:00
committed by Gerrit Code Review
13 changed files with 87 additions and 54 deletions

View File

@ -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_);

View File

@ -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) ||