X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftarget%2Fimage.c;h=e77e190115ab6bbe6991e55d2998b03e663d79e9;hb=3a693ef526575633cc350a69aa1a5d1f08e64c46;hp=d36fbc34c83bb8eb543439bb2a3ebcc4c03be1a8;hpb=ecad76061f6edff5db67ad05e6514dff6cd6efc7;p=fw%2Fopenocd diff --git a/src/target/image.c b/src/target/image.c index d36fbc34c..e77e19011 100644 --- a/src/target/image.c +++ b/src/target/image.c @@ -158,7 +158,7 @@ static int image_ihex_buffer_complete_inner(struct image *image, char *lpszLine, /* we can't determine the number of sections that we'll have to create ahead of time, * so we locally hold them until parsing is finished */ - ihex->buffer = malloc(fileio->size >> 1); + ihex->buffer = malloc(fileio_size(fileio) >> 1); cooked_bytes = 0x0; image->num_sections = 0; section[image->num_sections].private = &ihex->buffer[cooked_bytes]; @@ -537,7 +537,7 @@ static int image_mot_buffer_complete_inner(struct image *image, char *lpszLine, /* we can't determine the number of sections that we'll have to create ahead of time, * so we locally hold them until parsing is finished */ - mot->buffer = malloc(fileio->size >> 1); + mot->buffer = malloc(fileio_size(fileio) >> 1); cooked_bytes = 0x0; image->num_sections = 0; section[image->num_sections].private = &mot->buffer[cooked_bytes]; @@ -747,7 +747,7 @@ int image_open(struct image *image, const char *url, const char *type_string) image->num_sections = 1; image->sections = malloc(sizeof(struct imagesection)); image->sections[0].base_address = 0x0; - image->sections[0].size = image_binary->fileio.size; + image->sections[0].size = fileio_size(&image_binary->fileio); image->sections[0].flags = 0; } else if (image->type == IMAGE_IHEX)