diff --git a/src/enc/vp8enci.h b/src/enc/vp8enci.h index f5e68877..2900db51 100644 --- a/src/enc/vp8enci.h +++ b/src/enc/vp8enci.h @@ -473,7 +473,7 @@ int VP8StatLoop(VP8Encoder* const enc); // in webpenc.c // Assign an error code to a picture. Return false for convenience. -int WebPEncodingSetError(WebPPicture* const pic, WebPEncodingError error); +int WebPEncodingSetError(const WebPPicture* const pic, WebPEncodingError error); int WebPReportProgress(VP8Encoder* const enc, int percent); // in analysis.c diff --git a/src/enc/webpenc.c b/src/enc/webpenc.c index 92c83c08..bbf604d4 100644 --- a/src/enc/webpenc.c +++ b/src/enc/webpenc.c @@ -306,10 +306,11 @@ static void StoreStats(VP8Encoder* const enc) { WebPReportProgress(enc, 100); // done! } -int WebPEncodingSetError(WebPPicture* const pic, WebPEncodingError error) { +int WebPEncodingSetError(const WebPPicture* const pic, + WebPEncodingError error) { assert((int)error < VP8_ENC_ERROR_LAST); assert((int)error >= VP8_ENC_OK); - pic->error_code = error; + ((WebPPicture*)pic)->error_code = error; return 0; }