File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -640,7 +640,7 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) {
640
640
opj_dparameters_t params ;
641
641
OPJ_COLOR_SPACE color_space ;
642
642
j2k_unpacker_t unpack = NULL ;
643
- size_t buffer_size = 0 , tile_bytes = 0 ;
643
+ size_t tile_bytes = 0 ;
644
644
unsigned n , tile_height , tile_width ;
645
645
int subsampling ;
646
646
int total_component_width = 0 ;
@@ -870,7 +870,7 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) {
870
870
tile_info .data_size = tile_bytes ;
871
871
}
872
872
873
- if (buffer_size < tile_info .data_size ) {
873
+ if (tile_info .data_size > 0 ) {
874
874
/* malloc check ok, overflow and tile size sanity check above */
875
875
UINT8 * new = realloc (state -> buffer , tile_info .data_size );
876
876
if (!new ) {
@@ -883,7 +883,6 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) {
883
883
to valgrind errors. */
884
884
memset (new , 0 , tile_info .data_size );
885
885
state -> buffer = new ;
886
- buffer_size = tile_info .data_size ;
887
886
}
888
887
889
888
if (!opj_decode_tile_data (
You can’t perform that action at this time.
0 commit comments