Sfoglia il codice sorgente

Fixed OOB access in audio_convertAccuracy test

Brick 1 anno fa
parent
commit
2833f2e7b5
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      test/testautomation_audio.c

+ 2 - 2
test/testautomation_audio.c

@@ -994,9 +994,9 @@ static int audio_convertAccuracy(void *arg)
     }
 
     /* Shuffle the data for good measure */
-    for (i = src_num - 1; i >= 0; --i) {
+    for (i = src_num - 1; i > 0; --i) {
         float f = src_data[i];
-        j = SDLTest_RandomIntegerInRange(0, src_num);
+        j = SDLTest_RandomIntegerInRange(0, i);
         src_data[i] = src_data[j];
         src_data[j] = f;
     }