mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-28 14:38:21 +01:00
Decode: return more meaningful error for animation
VP8_STATUS_NOT_ENOUGH_DATA -> VP8_STATUS_UNSUPPORTED_FEATURE Change-Id: If5ee9fd2c99fc5502996d3c786848fd9cc118fe7
This commit is contained in:
parent
ad452735c3
commit
302efcdb41
@ -372,10 +372,19 @@ static VP8StatusCode ParseHeadersInternal(const uint8_t* data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) {
|
VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) {
|
||||||
|
VP8StatusCode status;
|
||||||
|
int has_animation = 0;
|
||||||
assert(headers != NULL);
|
assert(headers != NULL);
|
||||||
// fill out headers, ignore width/height/has_alpha/has_animation.
|
// fill out headers, ignore width/height/has_alpha.
|
||||||
return ParseHeadersInternal(headers->data, headers->data_size,
|
status = ParseHeadersInternal(headers->data, headers->data_size,
|
||||||
NULL, NULL, NULL, NULL, headers);
|
NULL, NULL, NULL, &has_animation, headers);
|
||||||
|
if (status == VP8_STATUS_OK || status == VP8_STATUS_NOT_ENOUGH_DATA) {
|
||||||
|
// TODO(jzern): full support of animation frames will require API additions.
|
||||||
|
if (has_animation) {
|
||||||
|
status = VP8_STATUS_UNSUPPORTED_FEATURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user