GetFeatures: Detect invalid VP8X/VP8/VP8L data

This facilitates early error detection during decode/render.
Also, related refactoring.

Change-Id: Ia6c7cd91dec202a2a68dae2118f5981cf1eaa83d
This commit is contained in:
Urvang Joshi
2013-05-10 14:25:00 -07:00
parent 5818cff770
commit 352d0dee99
5 changed files with 31 additions and 54 deletions

View File

@ -149,9 +149,10 @@ size_t ChunksListDiskSize(const WebPChunk* chunk_list);
// Write out the given list of chunks into 'dst'.
uint8_t* ChunkListEmit(const WebPChunk* chunk_list, uint8_t* dst);
// Get the width & height of image stored in 'image_chunk'.
WebPMuxError MuxGetImageWidthHeight(const WebPChunk* const image_chunk,
int* const width, int* const height);
// Get the width, height and has_alpha info of image stored in 'image_chunk'.
WebPMuxError MuxGetImageInfo(const WebPChunk* const image_chunk,
int* const width, int* const height,
int* const has_alpha);
//------------------------------------------------------------------------------
// MuxImage object management.
@ -233,12 +234,6 @@ uint8_t* MuxEmitRiffHeader(uint8_t* const data, size_t size);
// or if 'id' is not known.
WebPChunk** MuxGetChunkListFromId(const WebPMux* mux, WebPChunkId id);
// Get the canvas width and height after validating that VP8X/VP8/VP8L chunk and
// canvas size are valid. This method can be used for validation-only purposes
// by passing 'width' and 'height' to be NULL.
WebPMuxError MuxGetCanvasSize(const WebPMux* const mux, int* width,
int* height);
// Validates the given mux object.
WebPMuxError MuxValidate(const WebPMux* const mux);