aboutsummaryrefslogtreecommitdiff
path: root/src/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/control.c')
-rw-r--r--src/control.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/control.c b/src/control.c
index 80cf7ce..4e49de4 100644
--- a/src/control.c
+++ b/src/control.c
@@ -17,6 +17,12 @@
int control_add_image(ControlContext *ctx, uint16_t *image, int width, int height, double tilt) {
+ if ( ctx->images ) {
+ ctx->images = realloc(ctx->images, (ctx->n_images+1)*sizeof(ImageRecord));
+ } else {
+ ctx->images = malloc(sizeof(ImageRecord));
+ }
+
ctx->images[ctx->n_images].tilt = tilt;
ctx->images[ctx->n_images].omega = ctx->omega;
ctx->images[ctx->n_images].image = image;
@@ -55,6 +61,8 @@ ControlContext *control_ctx_new() {
ctx->have_centres = 0;
ctx->cell = NULL;
ctx->dirax = NULL;
+ ctx->n_images = 0;
+ ctx->images = NULL;
return ctx;