summaryrefslogtreecommitdiffstats
path: root/test/control.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-09 11:34:30 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-09 11:34:30 +0100
commitcd7590bac56800586c4aadef077d1effe03b00c4 (patch)
tree38863a4996a42301cb68becb88f137d2c28ccac3 /test/control.c
parentcc74561cfaff3a4c8719b6972d4ec5c21be535ea (diff)
downloaduca-cd7590bac56800586c4aadef077d1effe03b00c4.tar.gz
uca-cd7590bac56800586c4aadef077d1effe03b00c4.tar.bz2
uca-cd7590bac56800586c4aadef077d1effe03b00c4.tar.xz
uca-cd7590bac56800586c4aadef077d1effe03b00c4.zip
Use correct number of bytes per pixel when allocating buffers
Diffstat (limited to 'test/control.c')
-rw-r--r--test/control.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/control.c b/test/control.c
index 010d6bc..1eb7e0f 100644
--- a/test/control.c
+++ b/test/control.c
@@ -309,12 +309,12 @@ int main(int argc, char *argv[])
gtk_tree_view_column_set_cell_data_func(value_column, GTK_CELL_RENDERER(value_renderer), value_cell_data_func, NULL, NULL);
/* start grabbing and thread */
- int mem_size = bits_per_sample == 8 ? 1 : 2;
+ int pixel_size = bits_per_sample == 8 ? 1 : 2;
struct ThreadData td;
uca_cam_alloc(cam, 20);
td.image = image;
td.pixbuf = pixbuf;
- td.buffer = (guchar *) g_malloc(mem_size * width * height);
+ td.buffer = (guchar *) g_malloc(pixel_size * width * height);
td.pixels = gdk_pixbuf_get_pixels(pixbuf);
td.width = width;
td.height = height;