diff options
| author | Luis Ibanez <luis.ibanez@gmail.com> | 2010-08-20 21:33:43 +0000 |
|---|---|---|
| committer | Luis Ibanez <luis.ibanez@gmail.com> | 2010-08-20 21:33:43 +0000 |
| commit | 2f9e80da9c96a278da7e608a7007a64cb6430ccd (patch) | |
| tree | c5b2b6a33e93939fe100b00d7be5214e6c5eea17 | |
| parent | 871cd3968f90f9176f017dca9abea8225cc2814f (diff) | |
BUG: Fixing case in which the pointer the data buffers doesn't
get positioned at the beginning of the buffer after a new
buffer load. This case only happens when the pointer happens
to be at the end of the buffer when the request for the new
block arrives. Fix contributed by Bill Hoffman.
| -rw-r--r-- | libopenjpeg/cio.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libopenjpeg/cio.c b/libopenjpeg/cio.c index 05c7101c..fd914ad0 100644 --- a/libopenjpeg/cio.c +++ b/libopenjpeg/cio.c @@ -406,6 +406,14 @@ OPJ_UINT32 opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu p_stream->m_byte_offset += p_stream->m_bytes_in_buffer; p_stream->m_bytes_in_buffer = 0; } + else + { + /* case where we are already at the end of the buffer + so reset the m_current_data to point to the start of the + stored buffer to get ready to read from disk*/ + p_stream->m_current_data = p_stream->m_stored_data; + } + while (true) |
