Zebediah Figura : qcap: Use malloc() instead of heap_alloc().

Alexandre Julliard julliard at winehq.org
Fri Nov 27 16:04:38 CST 2020


Module: wine
Branch: master
Commit: 8bcb4466c99dcc5622bca584ca3b9a00f3e0d012
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8bcb4466c99dcc5622bca584ca3b9a00f3e0d012

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Nov 26 22:34:30 2020 -0600

qcap: Use malloc() instead of heap_alloc().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/qcap/v4l.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c
index b5a599eb0bc..2ba423ea0e5 100644
--- a/dlls/qcap/v4l.c
+++ b/dlls/qcap/v4l.c
@@ -116,9 +116,9 @@ static void v4l_device_destroy(struct video_capture_device *device)
     if (device->fd != -1)
         video_close(device->fd);
     if (device->caps_count)
-        heap_free(device->caps);
-    heap_free(device->image_data);
-    heap_free(device);
+        free(device->caps);
+    free(device->image_data);
+    free(device);
 }
 
 static const struct caps *find_caps(struct video_capture_device *device, const AM_MEDIA_TYPE *mt)
@@ -167,7 +167,7 @@ static HRESULT set_caps(struct video_capture_device *device, const struct caps *
     height = caps->video_info.bmiHeader.biHeight;
     image_size = width * height * caps->video_info.bmiHeader.biBitCount / 8;
 
-    if (!(image_data = heap_alloc(image_size)))
+    if (!(image_data = malloc(image_size)))
     {
         ERR("Failed to allocate memory.\n");
         return E_OUTOFMEMORY;
@@ -183,14 +183,14 @@ static HRESULT set_caps(struct video_capture_device *device, const struct caps *
             || format.fmt.pix.height != height)
     {
         ERR("Failed to set pixel format: %s.\n", strerror(errno));
-        heap_free(image_data);
+        free(image_data);
         return VFW_E_TYPE_NOT_ACCEPTED;
     }
 
     device->current_caps = caps;
     device->image_size = image_size;
     device->image_pitch = width * caps->video_info.bmiHeader.biBitCount / 8;
-    heap_free(device->image_data);
+    free(device->image_data);
     device->image_data = image_data;
     return S_OK;
 }
@@ -407,7 +407,7 @@ struct video_capture_device *v4l_device_create(USHORT index)
 
     have_libv4l2 = video_init();
 
-    if (!(device = heap_alloc_zero(sizeof(*device))))
+    if (!(device = calloc(1, sizeof(*device))))
         return NULL;
 
     sprintf(path, "/dev/video%i", index);
@@ -509,7 +509,7 @@ struct video_capture_device *v4l_device_create(USHORT index)
         else
             ERR("Failed to get fps: %s.\n", strerror(errno));
 
-        new_caps = heap_realloc(device->caps, (device->caps_count + 1) * sizeof(*device->caps));
+        new_caps = realloc(device->caps, (device->caps_count + 1) * sizeof(*device->caps));
         if (!new_caps)
             goto error;
         device->caps = new_caps;




More information about the wine-cvs mailing list