diff --git a/src/enc/picture.c b/src/enc/picture.c index e1e72c74..26679a72 100644 --- a/src/enc/picture.c +++ b/src/enc/picture.c @@ -39,7 +39,6 @@ int WebPPictureInitInternal(WebPPicture* picture, int version) { memset(picture, 0, sizeof(*picture)); picture->writer = DummyWriter; WebPEncodingSetError(picture, VP8_ENC_OK); - VP8EncDspARGBInit(); } return 1; } diff --git a/src/enc/picture_csp.c b/src/enc/picture_csp.c index 5a1f8de8..4524953c 100644 --- a/src/enc/picture_csp.c +++ b/src/enc/picture_csp.c @@ -1060,6 +1060,8 @@ static int Import(WebPPicture* const picture, } if (!WebPPictureAlloc(picture)) return 0; + VP8EncDspARGBInit(); + assert(step >= (import_alpha ? 4 : 3)); if (import_alpha) { for (y = 0; y < height; ++y) {