summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-09-21 14:13:16 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-09-21 14:13:16 +0200
commit39082fc6654553f43f6f3a73e0eeaedebc4bdf9f (patch)
treea75be81835084388edfddaece8a142019751257e /src/lib
parent7711307d865d46ca1bb8bb152071178b10066d05 (diff)
Workaround Coverity CID 113061
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/j2k.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c
index f517ff88..52f9c98e 100644
--- a/src/lib/openjp2/j2k.c
+++ b/src/lib/openjp2/j2k.c
@@ -11136,6 +11136,11 @@ OPJ_BOOL opj_j2k_encode(opj_j2k_t * p_j2k,
l_current_data = l_new_current_data;
l_max_tile_size = l_current_tile_size;
}
+ if (l_current_data == NULL) {
+ /* Shoul not happen in practice, but will avoid Coverity to */
+ /* complain about a null pointer dereference */
+ return OPJ_FALSE;
+ }
/* copy image data (32 bit) to l_current_data as contiguous, all-component, zero offset buffer */
/* 32 bit components @ 8 bit precision get converted to 8 bit */