coverity: avoid dereference after null check

All decompress functions used after this check take into account that
encoder->palette is not NULL. So, if we already detected that the
palette is NULL, let's just return early.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
This commit is contained in:
Fabiano Fidêncio 2016-04-04 07:42:56 +02:00
parent 89b902789b
commit 3312a0f70b

View File

@ -647,6 +647,7 @@ void lz_decode(LzContext *lz, LzImageType to_type, uint8_t *buf)
if (!encoder->palette) {
encoder->usr->error(encoder->usr,
"a palette is missing (for bpp to rgb decoding)\n");
return;
}
switch (encoder->type) {
case LZ_IMAGE_TYPE_PLT1_BE: