[trunk] Import (ugly) patch from sumatrapdf team. This feels like a hack rather than...
[openjpeg.git] / src / lib / openjp2 / tcd.c
index 88372e2384e75a332b33eeb93a3769dd0167c768..fc77b5e48224a916b8e0739db5c1dad0fd9948b9 100644 (file)
@@ -1746,7 +1746,7 @@ void opj_tcd_code_block_enc_deallocate (opj_tcd_precinct_t * p_precinct)
                 
                 for     (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno)  {
                         if (l_code_block->data) {
-                                opj_free(l_code_block->data);
+                                opj_free(l_code_block->data - 1);
                                 l_code_block->data = 00;
                         }