Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix JPEG_get_iccp #231

Merged
merged 1 commit into from
Nov 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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