]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
TagLine patch - Robert Colquhoun(rjc@trump.net.au)
authorRobert Colquhoun <rjc@trump.net.au>
Sat, 2 Jan 1999 04:18:32 +0000 (04:18 +0000)
committerRobert Colquhoun <rjc@trump.net.au>
Sat, 2 Jan 1999 04:18:32 +0000 (04:18 +0000)
Patch which fixes corruption at the end of the tagline on each
fax page transmitted.  Caused by a calculation error

faxd/TagLine.c++
faxd/tagtest.c++

index c81a15c369da393ca6e5ae6fcaf3b90a4359e093..bb5f2b0c00aaf37ffc3778ab27255c365f4c59f6 100644 (file)
@@ -236,7 +236,8 @@ FaxModem::imageTagLine(u_char* buf, u_int fillorder, const Class2Params& params)
      * adjusted by the look ahead, a factor of the number of
      * bits pending in the G3 decoder's bit accumulator.
      */
-    u_int decoded = dec.current() - roundup(dec.getPendingBits(),8) - buf;
+    u_int look_ahead = roundup(dec.getPendingBits(),8) / 8;
+    u_int decoded = dec.current() - look_ahead - buf;
 
     if (params.vr == VR_NORMAL) {
        /*
index 14f0655a5d17a745a883334795e7c9f85c4e607e..61a8c7fe8a992affae55c8b3dc3ad585ffe91824 100644 (file)
@@ -269,7 +269,8 @@ imageTagLine(u_char* buf, u_int fillorder, const Class2Params& params)
      * adjusted by the look ahead, a factor of the number of
      * bits pending in the G3 decoder's bit accumulator.
      */
-    u_int decoded = dec.current() - roundup(dec.getPendingBits(),8) - buf;
+    u_int look_ahead = roundup(dec.getPendingBits(),8) / 8;
+    u_int decoded = dec.current() - look_ahead - buf;
     if (params.vr == VR_NORMAL) {
        /*
         * Scale text vertically before encoding.  Note the