diff --git a/src/dec/frame.c b/src/dec/frame.c index 911c7ffc..a37becf1 100644 --- a/src/dec/frame.c +++ b/src/dec/frame.c @@ -179,7 +179,7 @@ static int FinishRow(VP8Decoder* const dec, VP8Io* const io) { FilterRow(dec); } - if (io->put) { + if (io->put != NULL) { if (!first_row) { y_start -= extra_y_rows; io->y = ydst; @@ -288,7 +288,7 @@ int VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io) { VP8StatusCode VP8EnterCritical(VP8Decoder* const dec, VP8Io* const io) { // Call setup() first. This may trigger additional decoding features on 'io'. // Note: Afterward, we must call teardown() not matter what. - if (io->setup && !io->setup(io)) { + if (io->setup != NULL && !io->setup(io)) { VP8SetError(dec, VP8_STATUS_USER_ABORT, "Frame setup failed"); return dec->status_; } @@ -346,7 +346,7 @@ int VP8ExitCritical(VP8Decoder* const dec, VP8Io* const io) { ok = WebPWorkerSync(&dec->worker_); } - if (io->teardown) { + if (io->teardown != NULL) { io->teardown(io); } return ok; diff --git a/src/dec/idec.c b/src/dec/idec.c index 42d2a923..cb1b6693 100644 --- a/src/dec/idec.c +++ b/src/dec/idec.c @@ -268,7 +268,7 @@ static void RestoreContext(const MBContext* context, VP8Decoder* const dec, static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) { if (idec->state_ == STATE_VP8_DATA) { VP8Io* const io = &idec->io_; - if (io->teardown) { + if (io->teardown != NULL) { io->teardown(io); } } @@ -574,7 +574,8 @@ WebPIDecoder* WebPINewDecoder(WebPDecBuffer* output_buffer) { VP8InitIo(&idec->io_); WebPResetDecParams(&idec->params_); - idec->params_.output = output_buffer ? output_buffer : &idec->output_; + idec->params_.output = (output_buffer != NULL) ? output_buffer + : &idec->output_; WebPInitCustomIo(&idec->params_, &idec->io_); // Plug the I/O functions. return idec; diff --git a/src/dec/io.c b/src/dec/io.c index 594804c2..67bd3bf5 100644 --- a/src/dec/io.c +++ b/src/dec/io.c @@ -601,7 +601,7 @@ static int CustomPut(const VP8Io* io) { return 0; } num_lines_out = p->emit(io, p); - if (p->emit_alpha) { + if (p->emit_alpha != NULL) { p->emit_alpha(io, p); } p->last_y += num_lines_out; diff --git a/src/dec/vp8.c b/src/dec/vp8.c index 253cb6b6..3b3ec690 100644 --- a/src/dec/vp8.c +++ b/src/dec/vp8.c @@ -766,9 +766,7 @@ void VP8Clear(VP8Decoder* const dec) { if (dec->use_threads_) { WebPWorkerEnd(&dec->worker_); } - if (dec->mem_) { - free(dec->mem_); - } + free(dec->mem_); dec->mem_ = NULL; dec->mem_size_ = 0; memset(&dec->br_, 0, sizeof(dec->br_)); diff --git a/src/dec/webp.c b/src/dec/webp.c index aa3a703f..7de050d0 100644 --- a/src/dec/webp.c +++ b/src/dec/webp.c @@ -397,7 +397,7 @@ VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) { // WebPDecParams void WebPResetDecParams(WebPDecParams* const params) { - if (params) { + if (params != NULL) { memset(params, 0, sizeof(*params)); } }