mux: add version checked entry points

Change-Id: I3bf5b25b17c06ec092f8ad1c14eea411aa9471c1
This commit is contained in:
James Zern
2012-04-25 17:27:16 -07:00
parent 6a0abdaa3a
commit 03f1f49321
3 changed files with 24 additions and 8 deletions

View File

@ -26,8 +26,9 @@ static void MuxInit(WebPMux* const mux) {
mux->state_ = WEBP_MUX_STATE_PARTIAL;
}
WebPMux* WebPMuxNew(void) {
WebPMux* const mux = (WebPMux*)malloc(sizeof(WebPMux));
WebPMux* WebPNewInternal(int version) {
WebPMux* const mux = (version == WEBP_MUX_ABI_VERSION) ?
(WebPMux*)malloc(sizeof(WebPMux)) : NULL;
if (mux) MuxInit(mux);
return mux;
}