diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2012-11-18 00:18:24 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2012-11-18 00:18:24 +0000 |
commit | 7cedf303a515993e87302f8c042cb139586b890f (patch) | |
tree | 7f9fe4225b1e9bf42c3a000ba106288ef101e4fd /converter | |
parent | b5335b19fd14114ed4c4f840865c0ed058c587f7 (diff) | |
download | netpbm-mirror-7cedf303a515993e87302f8c042cb139586b890f.tar.gz netpbm-mirror-7cedf303a515993e87302f8c042cb139586b890f.tar.xz netpbm-mirror-7cedf303a515993e87302f8c042cb139586b890f.zip |
fix incorrect output, memory leak
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1762 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r-- | converter/pbm/xbmtopbm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/converter/pbm/xbmtopbm.c b/converter/pbm/xbmtopbm.c index 2ac61ccf..0cbebc5e 100644 --- a/converter/pbm/xbmtopbm.c +++ b/converter/pbm/xbmtopbm.c @@ -364,13 +364,14 @@ main(int argc, bitrow[i] = bitreverse[*p++]; if (cols % 8 > 0) { - bitrow[bytesPerRow] >>= 8 - cols % 8; - bitrow[bytesPerRow] <<= 8 - cols % 8; + bitrow[bytesPerRow-1] >>= 8 - cols % 8; + bitrow[bytesPerRow-1] <<= 8 - cols % 8; } pbm_writepbmrow_packed(stdout, bitrow, cols, 0); } + pbm_freerow(bitrow); free(data); pm_close(stdout); |