]> granicus.if.org Git - openjpeg/commitdiff
[trunk] removed unnecessary operation in opj_bio_flush (fixes issue 461)
authorMatthieu Darbois <mayeut@users.noreply.github.com>
Tue, 23 Dec 2014 16:05:19 +0000 (16:05 +0000)
committerMatthieu Darbois <mayeut@users.noreply.github.com>
Tue, 23 Dec 2014 16:05:19 +0000 (16:05 +0000)
src/lib/openjp2/bio.c

index 636264ce3286d68efa507805cb991e3ea243f03a..3ce649275394ec51f679d66838a4b513acccaf6c 100644 (file)
@@ -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;
 }