diff options
author | Dave Chapman <dave@dchapman.com> | 2010-01-28 11:17:01 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2010-01-28 11:17:01 +0000 |
commit | c5491758dd7b23fc06822d4f17cf432325cd6b76 (patch) | |
tree | 17dd956ca2ec8245fba4780eea8b4f08561ba8dc | |
parent | 428064016bdc569dbb4b794dca35e06634254c12 (diff) | |
download | rockbox-c5491758dd7b23fc06822d4f17cf432325cd6b76.tar.gz 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
-rw-r--r-- | apps/plugins/crypt_firmware.c | 10 |
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) | |||
170 | return PLUGIN_ERROR; | 170 | return PLUGIN_ERROR; |
171 | } | 171 | } |
172 | 172 | ||
173 | if (length > buf_size) { | ||
174 | rb->splash(HZ*2, "File too big"); | ||
175 | return PLUGIN_ERROR; | ||
176 | } | ||
177 | |||
178 | /* Get the audio buffer */ | 173 | /* Get the audio buffer */ |
179 | buf = rb->plugin_get_audio_buffer((size_t *)&buf_size); | 174 | buf = rb->plugin_get_audio_buffer((size_t *)&buf_size); |
180 | 175 | ||
181 | /* Use uncached alias for buf - equivalent to buf |= 0x40000000 */ | 176 | /* Use uncached alias for buf - equivalent to buf |= 0x40000000 */ |
182 | buf += 0x10000000; | 177 | buf += 0x10000000; |
183 | 178 | ||
179 | if (length > buf_size) { | ||
180 | rb->splash(HZ*2, "File too big"); | ||
181 | return PLUGIN_ERROR; | ||
182 | } | ||
183 | |||
184 | n = rb->read(fd, buf, length); | 184 | n = rb->read(fd, buf, length); |
185 | if (n < length) { | 185 | if (n < length) { |
186 | rb->splash(HZ*2, "Cannot read file"); | 186 | rb->splash(HZ*2, "Cannot read file"); |