diff options
author | yzrh <yzrh@noema.org> | 2022-12-31 21:17:28 +0000 |
---|---|---|
committer | yzrh <yzrh@noema.org> | 2022-12-31 21:17:28 +0000 |
commit | bffb8ce8a4f21f3e20513e7f76a949acb190e14a (patch) | |
tree | 8d34d688ebc4f703699e2bb2b9165ed442faf48f /src | |
parent | 3ac51d66b9e7b7169c99676f39e7dab457f6b979 (diff) | |
download | melon-bffb8ce8a4f21f3e20513e7f76a949acb190e14a.tar.gz melon-bffb8ce8a4f21f3e20513e7f76a949acb190e14a.tar.zst |
Fix JBIG decoder.
Signed-off-by: yzrh <yzrh@noema.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/jbig.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -209,6 +209,17 @@ _procline(int line, char *a, char *b, char *c) /* The encoder must be erroneous */ 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++) { _decode(cx); |