Fix JBIG decoder.
Signed-off-by: yzrh <yzrh@noema.org>
This commit is contained in:
parent
3ac51d66b9
commit
bffb8ce8a4
1 changed files with 11 additions and 0 deletions
11
src/jbig.c
11
src/jbig.c
|
@ -209,6 +209,17 @@ _procline(int line, char *a, char *b, char *c)
|
||||||
/* The encoder must be erroneous */
|
/* The encoder must be erroneous */
|
||||||
uint16_t cx = 0;
|
uint16_t cx = 0;
|
||||||
|
|
||||||
|
if (line > 0) {
|
||||||
|
cx += (_ret[_width_padded * (_height - line)] & 0x20) << 2;
|
||||||
|
cx += _ret[_width_padded * (_height - line)] & 0x40;
|
||||||
|
cx += (_ret[_width_padded * (_height - line)] & 0x80) >> 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line > 1) {
|
||||||
|
cx += (_ret[_width_padded * (_height - line + 1)] & 0x40) >> 4;
|
||||||
|
cx += (_ret[_width_padded * (_height - line + 1)] & 0x80) >> 6;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < _width; i++) {
|
for (int i = 0; i < _width; i++) {
|
||||||
_decode(cx);
|
_decode(cx);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue