diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2015-06-19 03:02:42 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2015-06-19 03:02:42 +0000 |
commit | 8c2dab4922b514045cbae8e71ba93aaf8c0fff48 (patch) | |
tree | afb884f30d695c9faea1ea17768cded4069eaf4e /converter/pbm/pbmtoppa/cutswath.c | |
parent | 921c08b68f785180a918591ea0699de6275d202d (diff) | |
download | netpbm-mirror-8c2dab4922b514045cbae8e71ba93aaf8c0fff48.tar.gz netpbm-mirror-8c2dab4922b514045cbae8e71ba93aaf8c0fff48.tar.xz netpbm-mirror-8c2dab4922b514045cbae8e71ba93aaf8c0fff48.zip |
Release 10.70.07
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2557 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/pbm/pbmtoppa/cutswath.c')
-rw-r--r-- | converter/pbm/pbmtoppa/cutswath.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/converter/pbm/pbmtoppa/cutswath.c b/converter/pbm/pbmtoppa/cutswath.c index 0d44ce45..d3f15c03 100644 --- a/converter/pbm/pbmtoppa/cutswath.c +++ b/converter/pbm/pbmtoppa/cutswath.c @@ -39,13 +39,15 @@ cut_pbm_swath(pbm_stat* pbm,ppa_stat* prn,int maxlines,ppa_sweep_data* sweep_dat int shift; ppa_nozzle_data nozzles[2]; + ppa = NULL; + /* shift = 6 if DPI==300 */ /* shift = 12 if DPI==600 */ shift = ( prn->DPI == 300 ? 6:12 ) ; /* safeguard against the user freeing these */ - sweep_data->image_data=NULL; - sweep_data->nozzle_data=NULL; + sweep_data->image_data = NULL; + sweep_data->nozzle_data = NULL; /* read the data from the input file */ width8 = (pbm->width + 7) / 8; @@ -66,7 +68,7 @@ cut_pbm_swath(pbm_stat* pbm,ppa_stat* prn,int maxlines,ppa_sweep_data* sweep_dat if(!pbm_readline(pbm,data)) { fprintf(stderr,"cutswath(): A-could not read top margin\n"); - free(data); + free (data); data=NULL; return 0; } @@ -77,10 +79,10 @@ cut_pbm_swath(pbm_stat* pbm,ppa_stat* prn,int maxlines,ppa_sweep_data* sweep_dat if(!pbm_readline(pbm,data)) { fprintf(stderr,"cutswath(): could not clear bottom margin\n"); - free(data); + free (data); data=NULL; return 0; } - free(data); + free (data); data=NULL; return 1; } @@ -95,7 +97,7 @@ cut_pbm_swath(pbm_stat* pbm,ppa_stat* prn,int maxlines,ppa_sweep_data* sweep_dat if(!pbm_readline(pbm,data+width8*numlines)) { fprintf(stderr,"cutswath(): B-could not read next line\n"); - free(data); + free (data); data=NULL; return 0; } if(!got_nonblank) @@ -130,7 +132,7 @@ cut_pbm_swath(pbm_stat* pbm,ppa_stat* prn,int maxlines,ppa_sweep_data* sweep_dat { fprintf (stderr, "Ack! newleft=%d, newright=%d, left=%d, right=%d\n", newleft, newright, left, right); - free (data); + free (data); data=NULL; return 0; } @@ -177,13 +179,13 @@ cut_pbm_swath(pbm_stat* pbm,ppa_stat* prn,int maxlines,ppa_sweep_data* sweep_dat if(!pbm_readline(pbm,data)) { fprintf(stderr,"cutswath(): could not clear bottom margin\n"); - free(data); + free (data); data=NULL; return 0; } - free(data); + free (data); data=NULL; return 1; } - free(data); + free (data); data=NULL; return 0; /* error, since didn't get to lower margin, yet blank */ } @@ -197,7 +199,7 @@ cut_pbm_swath(pbm_stat* pbm,ppa_stat* prn,int maxlines,ppa_sweep_data* sweep_dat if(!pbm_readline(pbm,data+width8*numlines)) { fprintf(stderr,"cutswath(): C-could not read next line\n"); - free(data); + free (data); data=NULL; return 0; } numlines++; @@ -225,7 +227,7 @@ cut_pbm_swath(pbm_stat* pbm,ppa_stat* prn,int maxlines,ppa_sweep_data* sweep_dat if ((ppa = malloc ((p_width8+2*shift) * numlines)) == NULL) { fprintf(stderr,"cutswath(): could not malloc ppa storage\n"); - free (data); + free (data); data=NULL; return 0; } @@ -292,7 +294,7 @@ cut_pbm_swath(pbm_stat* pbm,ppa_stat* prn,int maxlines,ppa_sweep_data* sweep_dat } /* done with data */ - free(data); + free (data); data=NULL; /* place 0's in the last 12 columns */ memset (place, 0, numlines/2 * shift); |