[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 4fa9664: MakeProfiles: will complete operation
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 4fa9664: MakeProfiles: will complete operation if input has no rows |
Date: |
Sat, 23 Mar 2019 21:31:05 -0400 (EDT) |
branch: master
commit 4fa9664e6336d9aca7c451ffb52ebad9ec192b51
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
MakeProfiles: will complete operation if input has no rows
Until now, when the input catalog didn't have any rows (or profiles to
build), MakeProfiles would crash with a segmentation fault!
With this commit, it will complete, but just not make any actual images.
This fixes bug #55988.
---
NEWS | 1 +
bin/mkprof/ui.c | 9 +++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
index ced25a9..f9cb668 100644
--- a/NEWS
+++ b/NEWS
@@ -168,6 +168,7 @@ GNU Astronomy Utilities NEWS -*-
outline -*-
bug #55763: Crop not keeping Blank pixels on unsigned types.
bug #55844: WCS library (and thus all programs) can't deal with CROTAi
values.
bug #55845: Crash when necessary column not found from standard input.
+ bug #55988: MakeProfiles segfault when input catalog has no rows.
diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index 9117a6c..f2282dc 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -633,7 +633,7 @@ ui_read_cols(struct mkprofparams *p)
gal_checkset_allocate_copy("standard-input", &p->catname);
/* Set the number of objects. */
- p->num=cols->size;
+ p->num = cols ? cols->size : 0;
/* Put each column's data in the respective internal array. */
while(cols!=NULL)
@@ -1160,7 +1160,6 @@ ui_prepare_canvas(struct mkprofparams *p)
}
-
/* When individual mode is requested, write the WCS structure to a header
string to speed up the process: if we don't do it here, this process
will be necessary on every individual profile's output. So it is much
@@ -1407,8 +1406,10 @@ ui_preparations(struct mkprofparams *p)
else
ui_prepare_canvas(p);
- /* Read the (possible) RA/Dec inputs into X and Y for the builder.*/
- if(p->wcs)
+ /* Read the (possible) RA/Dec inputs into X and Y for the builder. NOTE:
+ It may happen that there are no input columns, in that case, just
+ ignore this step.*/
+ if(p->wcs && p->num)
ui_finalize_coordinates(p);
/* Prepare the random number generator. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master 4fa9664: MakeProfiles: will complete operation if input has no rows,
Mohammad Akhlaghi <=