Skip to content

Commit fc54d6b

Browse files
committed
GPU Huffman: fix big image overflow
if W*H*4 > UINT_MAX, the Huffman offset was cropped, eg. when running: gpujpegtool -e 30000x20000.p_u8.tst out.jpg
1 parent 9e14bd7 commit fc54d6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gpujpeg_huffman_gpu_encoder.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ gpujpeg_huffman_encoder_compaction_kernel (
579579

580580
// get info about the segment
581581
const unsigned int segment_byte_count = (d_segment[segment_idx].data_compressed_size + 15) & ~15; // number of bytes rounded up to multiple of 16
582-
const unsigned int segment_in_offset = d_segment[segment_idx].data_temp_index; // this should be aligned at least to 16byte boundary
582+
const size_t segment_in_offset = d_segment[segment_idx].data_temp_index; // this should be aligned at least to 16byte boundary
583583

584584
// first thread of each warp reserves space in output buffer
585585
if(0 == threadIdx.x) {

0 commit comments

Comments
 (0)