From ccddb3fc6feaf72f13f0698b20f710ee442d681a Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 27 Apr 2012 19:06:03 -0700 Subject: [PATCH] muxedit: remove a few redundant NULL checks Change-Id: I8285a7694d40b0f5c986dbfe40703251682eaafc --- src/mux/muxedit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mux/muxedit.c b/src/mux/muxedit.c index 98d9dc71..5d473d7b 100644 --- a/src/mux/muxedit.c +++ b/src/mux/muxedit.c @@ -29,7 +29,8 @@ static void MuxInit(WebPMux* const mux) { WebPMux* WebPNewInternal(int version) { WebPMux* const mux = (version == WEBP_MUX_ABI_VERSION) ? (WebPMux*)malloc(sizeof(WebPMux)) : NULL; - if (mux) MuxInit(mux); + // If mux is NULL MuxInit is a noop. + MuxInit(mux); return mux; } @@ -75,7 +76,7 @@ static WebPMuxError MuxSet(WebPMux* const mux, TAG_ID id, uint32_t nth, WebPImageInfo* image_info, int copy_data) { WebPChunk chunk; WebPMuxError err = WEBP_MUX_NOT_FOUND; - if (mux == NULL) return WEBP_MUX_INVALID_ARGUMENT; + assert(mux != NULL); assert(!IsWPI(id)); ChunkInit(&chunk);