summaryrefslogtreecommitdiff
path: root/apps/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/misc.c')
-rw-r--r--apps/misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/misc.c b/apps/misc.c
index e6c8a219ea..e17df02bff 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -1635,8 +1635,7 @@ int core_load_bmp(const char * filename, struct bitmap *bm, const int bmformat,
1635 handle = core_alloc_ex(buf_size, ops); 1635 handle = core_alloc_ex(buf_size, ops);
1636 if (handle > 0) 1636 if (handle > 0)
1637 { 1637 {
1638 core_pin(handle); 1638 bm->data = core_get_data_pinned(handle);
1639 bm->data = core_get_data(handle);
1640 lseek(fd, 0, SEEK_SET); /* reset to beginning of file */ 1639 lseek(fd, 0, SEEK_SET); /* reset to beginning of file */
1641 size_read = read_bmp_fd(fd, bm, buf_size, bmformat, NULL); 1640 size_read = read_bmp_fd(fd, bm, buf_size, bmformat, NULL);
1642 1641
@@ -1645,9 +1644,10 @@ int core_load_bmp(const char * filename, struct bitmap *bm, const int bmformat,
1645 core_shrink(handle, bm->data, size_read); 1644 core_shrink(handle, bm->data, size_read);
1646 *buf_reqd = size_read; 1645 *buf_reqd = size_read;
1647 } 1646 }
1647
1648 core_put_data_pinned(bm->data);
1648 bm->data = NULL; /* do this to force a crash later if the 1649 bm->data = NULL; /* do this to force a crash later if the
1649 caller doesnt call core_get_data() */ 1650 caller doesnt call core_get_data() */
1650 core_unpin(handle);
1651 } 1651 }
1652 else 1652 else
1653 *buf_reqd = buf_size; /* couldn't allocate pass bytes needed */ 1653 *buf_reqd = buf_size; /* couldn't allocate pass bytes needed */