diff --git a/src/camera/GPhoto.vala b/src/camera/GPhoto.vala
index e2af2c8..c02a3fd 100644
--- a/src/camera/GPhoto.vala
+++ b/src/camera/GPhoto.vala
@@ -201,11 +201,12 @@ namespace GPhoto {
         // if entire file fits in memory, return a stream from that ... can't merely wrap
         // MemoryInputStream around the camera_file buffer, as that will be destroyed when the
         // function returns
-        unowned uint8[] data;
-        res = camera_file.get_data_and_size(out data);
+        unowned uint8 *data;
+        ulong data_len;
+        res = camera_file.get_data_and_size(out data, out data_len);
         if (res == Result.OK) {
-            uint8[] buffer = new uint8[data.length];
-            Memory.copy(buffer, data, data.length);
+            uint8[] buffer = new uint8[data_len];
+            Memory.copy(buffer, data, buffer.length);
             
             return new MemoryInputStream.from_data(buffer, on_mins_destroyed);
         }
@@ -239,12 +240,13 @@ namespace GPhoto {
         
         // if buffer can be loaded into memory, return a copy of that (can't return buffer itself
         // as it will be destroyed when the camera_file is unref'd)
-        unowned uint8[] data;
-        res = camera_file.get_data_and_size(out data);
+        unowned uint8 *data;
+        ulong data_len;
+        res = camera_file.get_data_and_size(out data, out data_len);
         if (res != Result.OK)
             return null;
         
-        uint8[] buffer = new uint8[data.length];
+        uint8[] buffer = new uint8[data_len];
         Memory.copy(buffer, data, buffer.length);
         
         return buffer;
diff --git a/vapi/libgphoto2.vapi b/vapi/libgphoto2.vapi
index ed7f2a7..df2a630 100644
--- a/vapi/libgphoto2.vapi
+++ b/vapi/libgphoto2.vapi
@@ -104,7 +104,7 @@ namespace GPhoto {
     public class CameraFile {
         [CCode (cname="gp_file_new")]
         public static Result create(out CameraFile file);
-        public Result get_data_and_size(out unowned uint8[] data);
+        public Result get_data_and_size(out uint8 *data, out ulong data_len);
         public Result save(string filename);
         public Result slurp(uint8[] data, out size_t readlen);
     }
