[prev in list] [next in list] [prev in thread] [next in thread]
List: rockbox-cvs
Subject: wavrecord plugin: Add harmless sanity check
From: gerrit () rockbox ! org
Date: 2014-12-21 16:23:33
Message-ID: 201412211623.sBLGNXJ3017556 () giant ! haxx ! se
[Download RAW message or body]
commit 9a5f7ce0f2fd44ab5d78ae40f98fc4ab963517bf
Author: Thomas Jarosch <tomj@simonv.com>
Date: Sun Dec 21 17:22:09 2014 +0100
wavrecord plugin: Add harmless sanity check
cppcheck reported:
[rockbox/apps/plugins/wavrecord.c:3672]: (error) Array 'sampr[9][2]' index sampr[9][1] out of bounds.
Change-Id: Ib1e9c25842aa275b15d8d817018cc523269b1f42
diff --git a/apps/plugins/wavrecord.c b/apps/plugins/wavrecord.c
index 5cdf4fd..f7467b5 100644
--- a/apps/plugins/wavrecord.c
+++ b/apps/plugins/wavrecord.c
@@ -3669,7 +3669,7 @@ static int record_file(char *filename)
if (sampr[i][0] == mas)
break;
}
- if (!(update_wav_header(filename, sampr[i][1],
+ if (i == 9 || !(update_wav_header(filename, sampr[i][1],
(reccfg.channels + 1), bytes_written)))
{
rb->splash(HZ, "Updating WAV header failed");
_______________________________________________
rockbox-cvs mailing list
rockbox-cvs@cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic