aboutsummaryrefslogtreecommitdiff
path: root/src/stream.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-23 15:36:57 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:21 +0100
commit7410b92018097e975535ea228e1f302a3d463f42 (patch)
tree4d189ba59b7d188a7561c42550b94770094c5e18 /src/stream.c
parentf56ce1b9c6d6b5c9b365354585d32c5ead4869d6 (diff)
Don't try to write reflections to file if not indexed
Diffstat (limited to 'src/stream.c')
-rw-r--r--src/stream.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/stream.c b/src/stream.c
index 97c38b77..4707f327 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -255,11 +255,15 @@ void write_chunk(FILE *ofh, struct image *i, int f)
if ( (f & STREAM_PIXELS) || (f & STREAM_INTEGRATED) ) {
- fprintf(ofh, "\n");
- fprintf(ofh, REFLECTION_START_MARKER"\n");
- write_reflections_to_file(ofh, i->reflections, i->indexed_cell);
- fprintf(ofh, REFLECTION_END_MARKER"\n");
+ if ( i->reflections != NULL ) {
+
+ fprintf(ofh, "\n");
+ fprintf(ofh, REFLECTION_START_MARKER"\n");
+ write_reflections_to_file(ofh, i->reflections,
+ i->indexed_cell);
+ fprintf(ofh, REFLECTION_END_MARKER"\n");
+ }
}
fprintf(ofh, CHUNK_END_MARKER"\n\n");