[trunk] fixed a buffer overflow in opj_tcd_init_decode_tile
[openjpeg.git] / src / lib / openjp2 / raw.c
index 3d0aa5baf6af43fde0edc87e35617ead66e43f86..2498761c423f3ac00deca3093e2a458113237805 100644 (file)
@@ -1,7 +1,13 @@
 /*
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2007, Professor Benoit Macq
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+ * The copyright in this software is being made available under the 2-clauses 
+ * BSD License, included below. This software may be subject to other third 
+ * party and contributor rights, including patent rights, and no such rights
+ * are granted under this license.
+ *
+ * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2014, Professor Benoit Macq
+ * Copyright (c) 2003-2007, Francois-Olivier Devaux 
+ * Copyright (c) 2003-2014, Antonin Descampe
  * Copyright (c) 2005, Herve Drolon, FreeImage Team
  * All rights reserved.
  *
@@ -55,7 +61,7 @@ void opj_raw_destroy(opj_raw_t *raw) {
 
 OPJ_UINT32 opj_raw_numbytes(opj_raw_t *raw) {
        const ptrdiff_t diff = raw->bp - raw->start;
-  assert( diff <= 0xffffffff && diff >= 0 ); /* UINT32_MAX */
+  assert( diff <= (ptrdiff_t)0xffffffff && diff >= 0 ); /* UINT32_MAX */
        return (OPJ_UINT32)diff;
 }