summaryrefslogtreecommitdiffstats
path: root/apps/plugins/pictureflow
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2009-05-28 02:44:19 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2009-05-28 02:44:19 +0000
commitdda7580f8a1778e805bb22cd083fa5aea51fe62f (patch)
tree219aa6618e16526613761c7e4ea7b715d12b92a9 /apps/plugins/pictureflow
parent2a194c951d01f4af0cc968ba2bbeaba8fcc81cac (diff)
downloadrockbox-dda7580f8a1778e805bb22cd083fa5aea51fe62f.tar.gz
rockbox-dda7580f8a1778e805bb22cd083fa5aea51fe62f.tar.bz2
rockbox-dda7580f8a1778e805bb22cd083fa5aea51fe62f.zip
Remove use of uniqbuf in PictureFlow, preventing crash on 64-bit sim and freeing half of the plugin buffer on targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21109 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pictureflow')
-rw-r--r--apps/plugins/pictureflow/pictureflow.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 8d3af8112d..cd12152d43 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -216,8 +216,6 @@ typedef fb_data pix_t;
#define EV_EXIT 9999
#define EV_WAKEUP 1337
-#define UNIQBUF_SIZE (64*1024)
-
#define EMPTY_SLIDE CACHE_PREFIX "/emptyslide.pfraw"
#define EMPTY_SLIDE_BMP PLUGIN_DEMOS_DIR "/pictureflow_emptyslide.bmp"
#define SPLASH_BMP PLUGIN_DEMOS_DIR "/pictureflow_splash.bmp"
@@ -705,13 +703,10 @@ void init_reflect_table(void)
*/
int create_album_index(void)
{
- buf_size -= UNIQBUF_SIZE * sizeof(long);
- long *uniqbuf = (long *)(buf_size + (char *)buf);
- album = ((struct album_data *)uniqbuf) - 1;
+ album = ((struct album_data *)(buf_size + (char *) buf)) - 1;
rb->memset(&tcs, 0, sizeof(struct tagcache_search) );
album_count = 0;
rb->tagcache_search(&tcs, tag_album);
- rb->tagcache_search_set_uniqbuf(&tcs, uniqbuf, UNIQBUF_SIZE);
unsigned int l, old_l = 0;
album_names = buf;
album[0].name_idx = 0;
@@ -729,9 +724,10 @@ int create_album_index(void)
rb->strcpy(buf, tcs.result);
buf_size -= l;
buf = l + (char *)buf;
+ DEBUGF("%lX: %s\n", tcs.idxfd[tag_album] ? rb->lseek(tcs.idxfd[tag_album], 0, SEEK_CUR) : -1, tcs.result);
album[-album_count].seek = tcs.result_seek;
old_l = l;
- album_count++;
+ album_count++;
}
rb->tagcache_search_finish(&tcs);
ALIGN_BUFFER(buf, buf_size, 4);
@@ -741,7 +737,6 @@ int create_album_index(void)
tmp_album[i] = album[-i];
album = tmp_album;
buf = album + album_count;
- buf_size += UNIQBUF_SIZE * sizeof(long);
return (album_count > 0) ? 0 : ERROR_NO_ALBUMS;
}