BUGS: Coverty Scan, fixes some memory bugs

This commit is contained in:
iceman1001
2015-05-13 13:23:53 +02:00
parent a198737b44
commit 2696349f16
3 changed files with 6 additions and 5 deletions

View File

@@ -1892,7 +1892,8 @@ int getSamples(const char *Cmd, bool silent)
PrintAndLog("Unpacking...");
BitstreamOut bout = { got, bits_per_sample * n, 0};
int j =0;
for (j = 0; j * bits_per_sample < n * 8 && j < sizeof(GraphBuffer); j++) {
//for (j = 0; j * bits_per_sample < n * 8 && j < sizeof(GraphBuffer); j++) {
for (j = 0; j * bits_per_sample < n * 8 && j < n; j++) {
uint8_t sample = getByte(bits_per_sample, &bout);
GraphBuffer[j] = ((int) sample )- 128;
}