rbug: fix transmitted texture sizes
[mesa.git] / src / gallium / auxiliary / rbug / rbug_texture.c
index 3ee5e142b767d79df6c75e9126b37d87b49401ca..768e9505cca65fcdbdebba8df19a55b773d7a245 100644 (file)
@@ -283,9 +283,9 @@ int rbug_send_texture_info_reply(struct rbug_connection *__con,
                                  uint32_t format,
                                  uint32_t *width,
                                  uint32_t width_len,
-                                 uint16_t *height,
+                                 uint16_t *h16,
                                  uint32_t height_len,
-                                 uint16_t *depth,
+                                 uint16_t *d16,
                                  uint32_t depth_len,
                                  uint32_t blockw,
                                  uint32_t blockh,
@@ -299,6 +299,8 @@ int rbug_send_texture_info_reply(struct rbug_connection *__con,
        uint32_t __pos = 0;
        uint8_t *__data = NULL;
        int __ret = 0;
+       uint32_t *height = alloca(sizeof(uint32_t) * height_len);
+       uint32_t *depth = alloca(sizeof(uint32_t) * height_len);
 
        LEN(8); /* header */
        LEN(4); /* serial */
@@ -321,6 +323,11 @@ int rbug_send_texture_info_reply(struct rbug_connection *__con,
        if (!__data)
                return -ENOMEM;
 
+       for (int i = 0; i < height_len; i++)
+               height[i] = h16[i];
+       for (int i = 0; i < depth_len; i++)
+               depth[i] = d16[i];
+
        WRITE(4, int32_t, ((int32_t)RBUG_OP_TEXTURE_INFO_REPLY));
        WRITE(4, uint32_t, ((uint32_t)(__len / 4)));
        WRITE(4, uint32_t, serial); /* serial */