]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/xtea.c
os_support: Choose between direct.h and io.h using a configure check
[ffmpeg] / libavutil / xtea.c
index 07a66e56666a5d3a2882c06ee4eab69eac482b45..7c3a14c2bed6b179ccc7990a95bb5eb77a891c8f 100644 (file)
@@ -72,7 +72,7 @@ void av_xtea_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
     int i;
 
     if (decrypt) {
-        while (count > 0) {
+        while (count--) {
             xtea_crypt_ecb(ctx, dst, src, decrypt);
 
             if (iv) {
@@ -83,10 +83,9 @@ void av_xtea_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
 
             src   += 8;
             dst   += 8;
-            count -= 8;
         }
     } else {
-        while (count > 0) {
+        while (count--) {
             if (iv) {
                 for (i = 0; i < 8; i++)
                     dst[i] = src[i] ^ iv[i];
@@ -97,7 +96,6 @@ void av_xtea_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
             }
             src   += 8;
             dst   += 8;
-            count -= 8;
         }
     }
 }