We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
With some jp2 images, the decompressor freezes because of an infinite loop in https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/cio.c#L320
I guess those images could have something wrong but this inifinit loop should not exist. Here is a proposal of fix (works with my sample):
diff --git a/lib/penjp2/cio.c b/lib/openjp2/cio.c index 4fde9fe..7abb2cb 100644 --- a/lib/openjp2/cio.c +++ b/lib/openjp2/cio.c @@ -324,7 +324,9 @@ p_stream->m_bytes_in_buffer = p_stream->m_read_fn(p_stream->m_stored_data, p_stream->m_buffer_size, p_stream->m_user_data); - if (p_stream->m_bytes_in_buffer == (OPJ_SIZE_T) - 1) { + if (p_stream->m_bytes_in_buffer == 0) { + return 0; + } else if (p_stream->m_bytes_in_buffer == (OPJ_SIZE_T) - 1) { /* end of stream */ opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
The text was updated successfully, but these errors were encountered:
Can you post an image that goes into infinity ?
Sorry, something went wrong.
@nroduit Could you please provide a reproducer ;)?
I cannot reproduce with the decompress tool. So it should be related to the way I use the API.
I will reopen later if necessary.
No branches or pull requests
With some jp2 images, the decompressor freezes because of an infinite loop in https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/cio.c#L320
I guess those images could have something wrong but this inifinit loop should not exist. Here is a proposal of fix (works with my sample):
The text was updated successfully, but these errors were encountered: