Index: core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/bio.c |
diff --git a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/bio.c b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/bio.c |
index 5d49580178bbec81e7368f93e83d9ad9834240aa..3ce649275394ec51f679d66838a4b513acccaf6c 100644 |
--- a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/bio.c |
+++ b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/bio.c |
@@ -81,7 +81,7 @@ static OPJ_BOOL opj_bio_bytein(opj_bio_t *bio); |
OPJ_BOOL opj_bio_byteout(opj_bio_t *bio) { |
bio->buf = (bio->buf << 8) & 0xffff; |
bio->ct = bio->buf == 0xff00 ? 7 : 8; |
- if (bio->bp >= bio->end) { |
+ if ((OPJ_SIZE_T)bio->bp >= (OPJ_SIZE_T)bio->end) { |
return OPJ_FALSE; |
} |
*bio->bp++ = (OPJ_BYTE)(bio->buf >> 8); |
@@ -91,7 +91,7 @@ OPJ_BOOL opj_bio_byteout(opj_bio_t *bio) { |
OPJ_BOOL opj_bio_bytein(opj_bio_t *bio) { |
bio->buf = (bio->buf << 8) & 0xffff; |
bio->ct = bio->buf == 0xff00 ? 7 : 8; |
- if (bio->bp >= bio->end) { |
+ if ((OPJ_SIZE_T)bio->bp >= (OPJ_SIZE_T)bio->end) { |
return OPJ_FALSE; |
} |
bio->buf |= *bio->bp++; |
@@ -169,12 +169,10 @@ OPJ_UINT32 opj_bio_read(opj_bio_t *bio, OPJ_UINT32 n) { |
} |
OPJ_BOOL opj_bio_flush(opj_bio_t *bio) { |
- bio->ct = 0; |
if (! opj_bio_byteout(bio)) { |
return OPJ_FALSE; |
} |
if (bio->ct == 7) { |
- bio->ct = 0; |
if (! opj_bio_byteout(bio)) { |
return OPJ_FALSE; |
} |
@@ -183,12 +181,11 @@ OPJ_BOOL opj_bio_flush(opj_bio_t *bio) { |
} |
OPJ_BOOL opj_bio_inalign(opj_bio_t *bio) { |
- bio->ct = 0; |
if ((bio->buf & 0xff) == 0xff) { |
if (! opj_bio_bytein(bio)) { |
return OPJ_FALSE; |
} |
- bio->ct = 0; |
} |
+ bio->ct = 0; |
return OPJ_TRUE; |
} |