mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-28 14:38:21 +01:00
Fix few missing comparisons to NULL
Change-Id: I0d2ff8e8b507d17e80669b2b59fd5b017af995ed
This commit is contained in:
parent
b66caee410
commit
1579989e7b
@ -179,7 +179,7 @@ static int FinishRow(VP8Decoder* const dec, VP8Io* const io) {
|
|||||||
FilterRow(dec);
|
FilterRow(dec);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (io->put) {
|
if (io->put != NULL) {
|
||||||
if (!first_row) {
|
if (!first_row) {
|
||||||
y_start -= extra_y_rows;
|
y_start -= extra_y_rows;
|
||||||
io->y = ydst;
|
io->y = ydst;
|
||||||
@ -288,7 +288,7 @@ int VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io) {
|
|||||||
VP8StatusCode VP8EnterCritical(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'.
|
// Call setup() first. This may trigger additional decoding features on 'io'.
|
||||||
// Note: Afterward, we must call teardown() not matter what.
|
// 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");
|
VP8SetError(dec, VP8_STATUS_USER_ABORT, "Frame setup failed");
|
||||||
return dec->status_;
|
return dec->status_;
|
||||||
}
|
}
|
||||||
@ -346,7 +346,7 @@ int VP8ExitCritical(VP8Decoder* const dec, VP8Io* const io) {
|
|||||||
ok = WebPWorkerSync(&dec->worker_);
|
ok = WebPWorkerSync(&dec->worker_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (io->teardown) {
|
if (io->teardown != NULL) {
|
||||||
io->teardown(io);
|
io->teardown(io);
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
|
@ -268,7 +268,7 @@ static void RestoreContext(const MBContext* context, VP8Decoder* const dec,
|
|||||||
static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) {
|
static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) {
|
||||||
if (idec->state_ == STATE_VP8_DATA) {
|
if (idec->state_ == STATE_VP8_DATA) {
|
||||||
VP8Io* const io = &idec->io_;
|
VP8Io* const io = &idec->io_;
|
||||||
if (io->teardown) {
|
if (io->teardown != NULL) {
|
||||||
io->teardown(io);
|
io->teardown(io);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -574,7 +574,8 @@ WebPIDecoder* WebPINewDecoder(WebPDecBuffer* output_buffer) {
|
|||||||
VP8InitIo(&idec->io_);
|
VP8InitIo(&idec->io_);
|
||||||
|
|
||||||
WebPResetDecParams(&idec->params_);
|
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.
|
WebPInitCustomIo(&idec->params_, &idec->io_); // Plug the I/O functions.
|
||||||
|
|
||||||
return idec;
|
return idec;
|
||||||
|
@ -601,7 +601,7 @@ static int CustomPut(const VP8Io* io) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
num_lines_out = p->emit(io, p);
|
num_lines_out = p->emit(io, p);
|
||||||
if (p->emit_alpha) {
|
if (p->emit_alpha != NULL) {
|
||||||
p->emit_alpha(io, p);
|
p->emit_alpha(io, p);
|
||||||
}
|
}
|
||||||
p->last_y += num_lines_out;
|
p->last_y += num_lines_out;
|
||||||
|
@ -766,9 +766,7 @@ void VP8Clear(VP8Decoder* const dec) {
|
|||||||
if (dec->use_threads_) {
|
if (dec->use_threads_) {
|
||||||
WebPWorkerEnd(&dec->worker_);
|
WebPWorkerEnd(&dec->worker_);
|
||||||
}
|
}
|
||||||
if (dec->mem_) {
|
|
||||||
free(dec->mem_);
|
free(dec->mem_);
|
||||||
}
|
|
||||||
dec->mem_ = NULL;
|
dec->mem_ = NULL;
|
||||||
dec->mem_size_ = 0;
|
dec->mem_size_ = 0;
|
||||||
memset(&dec->br_, 0, sizeof(dec->br_));
|
memset(&dec->br_, 0, sizeof(dec->br_));
|
||||||
|
@ -397,7 +397,7 @@ VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) {
|
|||||||
// WebPDecParams
|
// WebPDecParams
|
||||||
|
|
||||||
void WebPResetDecParams(WebPDecParams* const params) {
|
void WebPResetDecParams(WebPDecParams* const params) {
|
||||||
if (params) {
|
if (params != NULL) {
|
||||||
memset(params, 0, sizeof(*params));
|
memset(params, 0, sizeof(*params));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user