Fix error in opj_memory_stream_skip

This commit is contained in:
Shahram Najm 2020-02-10 17:11:46 +00:00
parent 1f545e1a0f
commit 1f23533b68
1 changed files with 3 additions and 3 deletions

View File

@ -280,9 +280,9 @@ static OPJ_OFF_T opj_memory_stream_skip(OPJ_OFF_T nb_bytes, void* user_data)
l_nb_bytes = (OPJ_SIZE_T)nb_bytes; /* Allowed because it is positive */
/* Do not allow jumping past the end */
if (l_nb_bytes > mstream->dataSize - mstream->offset)
nb_bytes = mstream->dataSize - mstream->offset;
mstream->offset += l_nb_bytes;
return l_nb_bytes; /* Returm how far we jumped */
l_nb_bytes = mstream->dataSize - mstream->offset; /* Jump the max. */
mstream->offset += l_nb_bytes; /* Make the jump */
return l_nb_bytes; /* Return how far we jumped */
}
/* Sets the pointer to anywhere in the memory */