PGS fragmented ODS handling is wrong
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- swift
- Domain
- backend, computer-vision
Research direction
Start by reading PGS.parseNextSubtitle and ODS.parseODS, named in the issue. Check how the sequence flag controls continuation handling and where fragment dimensions and RLE data offsets are read. Done means objects spanning three or more fragments decode correctly without invalidRLE, while fragment appending stops at the last-in-sequence bit.
Written by the indexing model from the issue text.
Description
In PGS.parseNextSubtitle, after appending a continuation ODS fragment:
offset += segmentLength
if buffer[offset - 10] != 0x40 { break }
offset - 10 points 10 bytes before the end of the segment, into RLE data, not at the sequence flag (segment start + 3). Both branches then fall through to the same return, so an object split over 3+ fragments is returned after the second.
In ODS.parseODS, a middle fragment (sequence flag 0x00) is treated like a first fragment: it re-reads width/height from pixel data and skips 7 bytes of RLE (dataOffset = offset + 11).
Result: large objects decode wrong or throw invalidRLE, which aborts the run.
Fix: read the flag at the segment start, only take dimensions from a fragment with the first-in-sequence bit (0x80), use offset + 4 for any fragment without it, and keep appending until the last-in-sequence bit (0x40).
- Dominant language
- Swift
- Stars
- 42
- Forks
- 9
- Avg merge
- 9h 30m
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ecdye/macSubtitleOCR
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
ecdye/macSubtitleOCR#98 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ecdye/macSubtitleOCR#97 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ecdye/macSubtitleOCR#95 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
ecdye/macSubtitleOCR#94 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ecdye/macSubtitleOCR#87 ·
All issues in ecdye/macSubtitleOCR
Similar issues
-
[Cable Report] Apple Thunderbolt 3 Pro Cable 2 m (active), Apple Store, USB 3.2 Gen 2 (10 Gbps)Opencable-report
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
darrylmorley/whatcable#681 ·
-
[cloud_functions]: Apple platforms ignore custom domains passed as regionPossibly taken @ragavendranbala-TSL claimed this today. OpenNeeds Attention platform: ios platform: macos plugin: functions type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
firebase/flutterfire#19015 · 2 comments ·
Maintainers usually reply within 4 days
-
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 1/5 1-3 hours Newbie friendliness 75/100
Saffsanity/sill#444 · 1 comment ·
Maintainers usually reply within 1 day
-
P3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day