add LastFrame plugin, add bld_scripts
[goodguy/history.git] / cinelerra-5.0 / cinelerra / dcraw.c
index 300849b3f34e869bc4ff6fe53f582d26d548279c..9543ae84f31162d1167c99bbeaad9c0c5672a9d6 100644 (file)
@@ -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()