X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Fdcraw.c;h=9543ae84f31162d1167c99bbeaad9c0c5672a9d6;hb=6c0c8bd0e577001d1cc18c6c27d58e62f58a6bff;hp=300849b3f34e869bc4ff6fe53f582d26d548279c;hpb=0b311f8973ab36038f053abd2ae3ff2dd2347944;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/cinelerra/dcraw.c b/cinelerra-5.0/cinelerra/dcraw.c index 300849b3..9543ae84 100644 --- a/cinelerra-5.0/cinelerra/dcraw.c +++ b/cinelerra-5.0/cinelerra/dcraw.c @@ -2376,7 +2376,7 @@ void CLASS kodak_thumb_load_raw() void CLASS sony_decrypt (unsigned *data, int len, int start, int key) { - static unsigned pad[128], p; + static unsigned pad[128], p = 0; if (start) { for (p=0; p < 4; p++) @@ -2387,8 +2387,10 @@ void CLASS sony_decrypt (unsigned *data, int len, int start, int key) for (p=0; p < 127; p++) pad[p] = htonl(pad[p]); } - while (len--) - *data++ ^= pad[p++ & 127] = pad[(p+1) & 127] ^ pad[(p+65) & 127]; + while (len--) { + *data++ ^= pad[p & 127] = pad[(p+1) & 127] ^ pad[(p+65) & 127]; + p++; + } } void CLASS sony_load_raw()