Skip to content

Commit

Permalink
improved debug info when remaining bytes in stream is less than SOT l…
Browse files Browse the repository at this point in the history
…ength
  • Loading branch information
Aaron Boxer committed Jun 19, 2016
1 parent caef2a1 commit ebbf7f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/openjp2/j2k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4156,7 +4156,11 @@ static bool opj_j2k_read_sod (opj_j2k_t *p_j2k,
/* If we are here, we'll try to read the data after allocation */
/* Check enough bytes left in stream before allocation */
if ((int64_t)p_j2k->m_specific_param.m_decoder.m_sot_length > opj_stream_get_number_byte_left(p_stream)) {
opj_event_msg(p_manager, EVT_ERROR, "Tile part length size inconsistent with stream length\n");
opj_event_msg(p_manager,
EVT_ERROR,
"Tile part length size %d inconsistent with stream length %lld\n",
p_j2k->m_specific_param.m_decoder.m_sot_length,
opj_stream_get_number_byte_left(p_stream));
return false;
}
} else {
Expand Down

0 comments on commit ebbf7f0

Please sign in to comment.