Fix VP8ApplyNearLossless to respect const and stride.

Change-Id: I94a90220b5a175228fc48a4b299847b60cf5081b
This commit is contained in:
Vincent Rabaud
2017-04-21 15:35:11 +02:00
parent f768218966
commit 0dcd85b6c4
3 changed files with 41 additions and 19 deletions

View File

@ -1512,8 +1512,9 @@ WebPEncodingError VP8LEncodeStream(const WebPConfig* const config,
use_near_lossless =
(config->near_lossless < 100) && !enc->use_palette_ && !enc->use_predict_;
if (use_near_lossless) {
if (!VP8ApplyNearLossless(width, height, picture->argb,
config->near_lossless)) {
err = AllocateTransformBuffer(enc, width, height);
if (err != VP8_ENC_OK) goto Error;
if (!VP8ApplyNearLossless(picture, config->near_lossless, enc->argb_)) {
err = VP8_ENC_ERROR_OUT_OF_MEMORY;
goto Error;
}