Skip to content

Commit

Permalink
Merge pull request #231 from burrbull/fix_iccp
Browse files Browse the repository at this point in the history
fix JPEG_get_iccp
  • Loading branch information
Mrmaxmeier authored Nov 29, 2019
2 parents 01308a0 + aad04a8 commit 6daa845
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions dpx/src/dpx_jpegimage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,12 @@ unsafe fn JPEG_get_iccp(j_info: *mut JPEG_info) -> Option<pdf_stream> {
|| (*(*j_info).appn.offset(i as isize)).app_sig as u32 != JS_APPn_ICC as i32 as u32)
{
let icc = (*(*j_info).appn.offset(i as isize)).app_data as *mut JPEG_APPn_ICC;
/*if num_icc_seg < 0i32 && prev_id == 0i32 { // TODO: check unused
num_icc_seg = (*icc).num_chunks as i32
/* ICC chunks are sorted? */
} else */
if (*icc).seq_id as i32 != prev_id + 1i32
if num_icc_seg < 0i32 && prev_id == 0i32 {
} else if (*icc).seq_id as i32 != prev_id + 1i32
|| num_icc_seg != (*icc).num_chunks as i32
|| (*icc).seq_id as i32 > (*icc).num_chunks as i32
{
/* ICC chunks are sorted? */
warn!(
"Invalid JPEG ICC chunk: {} (p:{}, n:{})",
(*icc).seq_id as i32,
Expand Down

0 comments on commit 6daa845

Please sign in to comment.