From deb54d915a3289c25b17fd06a1b5885eeb966855 Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Wed, 29 Jun 2016 14:27:07 +0000 Subject: [PATCH] Clarify the expected 'config' lifespan in WebPIDecode() Change-Id: I08c880adc34d651a63fa2d07cfb07b1468a6df1b --- src/webp/decode.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/webp/decode.h b/src/webp/decode.h index 8a60351e..7a3bed93 100644 --- a/src/webp/decode.h +++ b/src/webp/decode.h @@ -471,16 +471,18 @@ static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) { // parameter, in which case the features will be parsed and stored into // config->input. Otherwise, 'data' can be NULL and no parsing will occur. // Note that 'config' can be NULL too, in which case a default configuration -// is used. +// is used. If 'config' is not NULL, it must outlive the WebPIDecoder object +// as some references to its fields will be used. No internal copy of 'config' +// is made. // The return WebPIDecoder object must always be deleted calling WebPIDelete(). // Returns NULL in case of error (and config->status will then reflect -// the error condition). +// the error condition, if available). WEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size, WebPDecoderConfig* config); // Non-incremental version. This version decodes the full data at once, taking // 'config' into account. Returns decoding status (which should be VP8_STATUS_OK -// if the decoding was successful). +// if the decoding was successful). Note that 'config' cannot be NULL. WEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size, WebPDecoderConfig* config);