diff options
Diffstat (limited to 'lib/libpbm2.c')
-rw-r--r-- | lib/libpbm2.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libpbm2.c b/lib/libpbm2.c index 3dbd7173..b7c750ce 100644 --- a/lib/libpbm2.c +++ b/lib/libpbm2.c @@ -227,12 +227,14 @@ pbm_readpbmrow_bitoffset(FILE * const ifP, unsigned int const last = pbm_packed_bytes(cols+rsh) - 1; /* Position within window of rightmost byte after shift */ - /* The original leftmost and rightmost chars. */ - unsigned char const origHead = window[0]; - unsigned char const origEnd = window[last]; + unsigned char origHead, origEnd; + /* The original leftmost and rightmost chars. */ pbm_readpbmrow_packed(ifP, window, cols, format); + origHead = window[0]; + origEnd = window[last]; + if (rsh > 0) { /* Target slot doesn't start on byte boundary; right-shift. */ unsigned char carryover; |