ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rcollate.c
(Generate patch)

Comparing ray/src/util/rcollate.c (file contents):
Revision 2.2 by greg, Thu Sep 5 18:30:58 2013 UTC vs.
Revision 2.3 by greg, Thu Sep 5 18:47:12 2013 UTC

# Line 279 | Line 279 | do_transpose(const MEMLOAD *mp)
279                  if (ni_columns <= 0)
280                          ni_columns = count_columns(rp);
281                  nrecords = rp->nrecs;
282 <        } else if ((ni_rows > 0) & (ni_columns > 0))
282 >        } else if ((ni_rows > 0) & (ni_columns > 0)) {
283                  nrecords = ni_rows*ni_columns;
284 <        else
284 >                if (nrecords > mp->len / -record_width) {
285 >                        fprintf(stderr,
286 >                            "Input too small for specified size and type\n");
287 >                        return(0);
288 >                }
289 >        } else
290                  nrecords = mp->len / -record_width;
291                                                  /* check sizes */
292          if (ni_rows <= 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines