[trunk] Rework assertion to work on 32bits system
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Tue, 11 Mar 2014 12:56:52 +0000 (12:56 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Tue, 11 Mar 2014 12:56:52 +0000 (12:56 +0000)
src/lib/openjp2/t2.c

index c7e29952f05be6381ba2637971d49922776c4c87..9cfc036397c2f4c6086d25c76d66d8b4e8f9fadb 100644 (file)
@@ -441,7 +441,7 @@ OPJ_BOOL opj_t2_decode_packets( opj_t2_t *p_t2,
 
         /* don't forget to release pi */
         opj_pi_destroy(l_pi,l_nb_pocs);
-        assert( l_current_data - p_src < (ptrdiff_t)UINT32_MAX );
+        assert( (OPJ_INT64)(l_current_data - p_src) < (OPJ_INT64)UINT32_MAX );
         *p_data_read = (OPJ_UINT32)(l_current_data - p_src);
         return OPJ_TRUE;
 }