summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-08-15 07:31:14 -0400
committerDavid Thompson <dthompson@member.fsf.org>2013-08-15 07:31:14 -0400
commit2fa15ac572e2fc1975e28b9dc6d8becf31f15534 (patch)
tree26181ea354e50c302478e8cd2d911793db66f500 /2d
parent18e7fee572248ad7d27f811a8a868b4f6cb771fe (diff)
Fix freeimage-load procedure that was not passing enough arguments.
This was a fucking pain to track down. freeimage-get-bits was randomly failing to load. Sometimes the program would run, sometimes it would crash with a null pointer dereference error.
Diffstat (limited to '2d')
-rw-r--r--2d/wrappers/freeimage.scm7
1 files changed, 3 insertions, 4 deletions
diff --git a/2d/wrappers/freeimage.scm b/2d/wrappers/freeimage.scm
index e7b1605..ab037d4 100644
--- a/2d/wrappers/freeimage.scm
+++ b/2d/wrappers/freeimage.scm
@@ -138,13 +138,12 @@
(%freeimage-get-height bitmap)
(%freeimage-get-bpp bitmap)))))
-(define-foreign %freeimage-load '* "FreeImage_Load" (list unsigned-int '*))
+(define-foreign %freeimage-load '* "FreeImage_Load" (list unsigned-int '* unsigned-int))
+(define-foreign %freeimage-unload void "FreeImage_Unload" '(*))
(define (freeimage-load image-format filename)
(wrap-freeimage-bitmap
- (%freeimage-load image-format (string->pointer filename))))
-
-(define-foreign %freeimage-unload void "FreeImage_Unload" '(*))
+ (%freeimage-load image-format (string->pointer filename) 0)))
(define (freeimage-unload bitmap)
(%freeimage-unload (unwrap-freeimage-bitmap bitmap)))