Workaround Coverity CID 169392
authorEven Rouault <even.rouault@spatialys.com>
Thu, 21 Sep 2017 12:10:49 +0000 (14:10 +0200)
committerEven Rouault <even.rouault@spatialys.com>
Thu, 21 Sep 2017 12:10:49 +0000 (14:10 +0200)
src/lib/openjp2/t1.c

index 9609895dbb79b75f0b269da411e75f07acbc2cb1..76744380f766c26ebf6ee7b4941d7f3214f495e1 100644 (file)
@@ -1999,6 +1999,10 @@ static OPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1,
         }
     } else if (cblk->numchunks == 1) {
         cblkdata = cblk->chunks[0].data;
+    } else {
+        /* Not sure if that can happen in practice, but avoid Coverity to */
+        /* think we will dereference a null cblkdta pointer */
+        return OPJ_TRUE;
     }
 
     /* For subtile decoding, directly decode in the decoded_data buffer of */