WebPAnimEncoder: Restore canvas before evaluating blending possibility.

Without this, the canvas may have been modified in-between two
GenerateCandidate() calls.

Change-Id: I0364a269caabdf282c30a8fa3c61896f0247342e
This commit is contained in:
Urvang Joshi 2016-04-19 16:13:45 -07:00
parent 6e12e1e3d2
commit e3912d560b

View File

@ -873,10 +873,14 @@ static WebPEncodingError GenerateCandidates(
WebPPicture* const curr_canvas = &enc->curr_canvas_copy_; WebPPicture* const curr_canvas = &enc->curr_canvas_copy_;
const WebPPicture* const prev_canvas = const WebPPicture* const prev_canvas =
is_dispose_none ? &enc->prev_canvas_ : &enc->prev_canvas_disposed_; is_dispose_none ? &enc->prev_canvas_ : &enc->prev_canvas_disposed_;
const int use_blending_ll = int use_blending_ll;
int use_blending_lossy;
CopyCurrentCanvas(enc);
use_blending_ll =
!is_key_frame && !is_key_frame &&
IsLosslessBlendingPossible(prev_canvas, curr_canvas, &params->rect_ll_); IsLosslessBlendingPossible(prev_canvas, curr_canvas, &params->rect_ll_);
const int use_blending_lossy = use_blending_lossy =
!is_key_frame && !is_key_frame &&
IsLossyBlendingPossible(prev_canvas, curr_canvas, &params->rect_lossy_, IsLossyBlendingPossible(prev_canvas, curr_canvas, &params->rect_lossy_,
config_lossy->quality); config_lossy->quality);