summaryrefslogtreecommitdiffstats
path: root/apps/plugins/crypt_firmware.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2010-01-28 11:17:01 +0000
committerDave Chapman <dave@dchapman.com>2010-01-28 11:17:01 +0000
commitc5491758dd7b23fc06822d4f17cf432325cd6b76 (patch)
tree17dd956ca2ec8245fba4780eea8b4f08561ba8dc /apps/plugins/crypt_firmware.c
parent428064016bdc569dbb4b794dca35e06634254c12 (diff)
downloadrockbox-c5491758dd7b23fc06822d4f17cf432325cd6b76.tar.gz
rockbox-c5491758dd7b23fc06822d4f17cf432325cd6b76.tar.bz2
rockbox-c5491758dd7b23fc06822d4f17cf432325cd6b76.zip
Bugfix - buf_size was being used before being initialised.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24363 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/crypt_firmware.c')
-rw-r--r--apps/plugins/crypt_firmware.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/plugins/crypt_firmware.c b/apps/plugins/crypt_firmware.c
index 84d7e11eaa..4dc236ef9a 100644
--- a/apps/plugins/crypt_firmware.c
+++ b/apps/plugins/crypt_firmware.c
@@ -170,17 +170,17 @@ enum plugin_status plugin_start(const void* parameter)
return PLUGIN_ERROR;
}
- if (length > buf_size) {
- rb->splash(HZ*2, "File too big");
- return PLUGIN_ERROR;
- }
-
/* Get the audio buffer */
buf = rb->plugin_get_audio_buffer((size_t *)&buf_size);
/* Use uncached alias for buf - equivalent to buf |= 0x40000000 */
buf += 0x10000000;
+ if (length > buf_size) {
+ rb->splash(HZ*2, "File too big");
+ return PLUGIN_ERROR;
+ }
+
n = rb->read(fd, buf, length);
if (n < length) {
rb->splash(HZ*2, "Cannot read file");