diff --git a/src/dec/idec.c b/src/dec/idec.c index d49ceb0a..672ba10e 100644 --- a/src/dec/idec.c +++ b/src/dec/idec.c @@ -538,9 +538,9 @@ VP8StatusCode WebPIUpdate(WebPIDecoder* const idec, const uint8_t* data, //------------------------------------------------------------------------------ -uint8_t* WebPIDecGetRGB(const WebPIDecoder* const idec, int *last_y, - int* width, int* height, int* stride) { - if (!idec || !idec->dec_ || idec->params_.mode != MODE_RGB || +uint8_t* WebPIDecGetRGB(const WebPIDecoder* const idec, int *last_y, int* width, + int* height, int* stride) { + if (!idec || !idec->dec_ || idec->params_.mode == MODE_YUV || idec->state_ <= STATE_PARTS0) { return NULL; } diff --git a/src/webp/decode.h b/src/webp/decode.h index 6c63d54b..60047e37 100644 --- a/src/webp/decode.h +++ b/src/webp/decode.h @@ -178,10 +178,11 @@ VP8StatusCode WebPIAppend(WebPIDecoder* const idec, const uint8_t* data, VP8StatusCode WebPIUpdate(WebPIDecoder* const idec, const uint8_t* data, uint32_t data_size); -// Returns the RGB image decoded so far. Returns NULL if output params are not -// initialized yet. *last_y is the index of last decoded row in raster scan -// order. Some pointers (*last_y, *width etc.) can be NULL if corresponding -// information is not needed. +// Returns the r/g/b/(a) image decoded so far. Returns NULL if output params +// are not initialized yet. The r/g/b/(a) output type corresponds to the mode +// specified in WebPINew()/WebPINewRGB(). *last_y is the index of last decoded +// row in raster scan order. Some pointers (*last_y, *width etc.) can be NULL if +// corresponding information is not needed. uint8_t* WebPIDecGetRGB(const WebPIDecoder* const idec, int *last_y, int* width, int* height, int* stride);