image_util_fenter();
image_util_retm_if(handle == NULL || handle->gif_encode_info.sources == NULL, "Invalid handle");
- for(i = 0; i < handle->gif_encode_info.source_count; i++) {
+ for (i = 0; i < handle->gif_encode_info.source_count; i++) {
IMAGE_UTIL_SAFE_FREE(handle->gif_encode_info.sources[i]);
}
IMAGE_UTIL_SAFE_FREE(handle->gif_encode_info.sources);
encode_s *_handle = (encode_s *) handle;
image_util_retvm_if(_handle == NULL, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle");
- image_util_retvm_if(size == NULL, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
+ image_util_retvm_if(_handle->dst_buffer != NULL && size == NULL, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
err = _image_util_encode_internal(_handle);
image_util_retvm_if((err != IMAGE_UTIL_ERROR_NONE), err, "_image_util_encode_internal failed");
- *size = _handle->dst_size;
+ if (size)
+ *size = _handle->dst_size;
return err;
}