Mux: Add WebPDataInit() and remove WebPImageInfo

Change-Id: If661f7d198e284a103a53a451e9f74805119fcf9
This commit is contained in:
Urvang Joshi
2012-07-06 14:29:35 +05:30
parent 8130c4cc64
commit 857650c8fc
4 changed files with 29 additions and 39 deletions

View File

@ -212,17 +212,23 @@ uint8_t* ChunkListEmit(const WebPChunk* chunk_list, uint8_t* dst) {
//------------------------------------------------------------------------------
// Manipulation of a WebPData object.
void WebPDataInit(WebPData* const webp_data) {
if (webp_data != NULL) {
memset(webp_data, 0, sizeof(*webp_data));
}
}
void WebPDataClear(WebPData* const webp_data) {
if (webp_data != NULL) {
free((void*)webp_data->bytes_);
memset(webp_data, 0, sizeof(*webp_data));
WebPDataInit(webp_data);
}
}
int WebPDataCopy(const WebPData* const src, WebPData* const dst) {
if (src == NULL || dst == NULL) return 0;
memset(dst, 0, sizeof(*dst));
WebPDataInit(dst);
if (src->bytes_ != NULL && src->size_ != 0) {
dst->bytes_ = (uint8_t*)malloc(src->size_);
if (dst->bytes_ == NULL) return 0;