Skip to content

Update to mupdf v1.26.0-rc1 and fix leak #135

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 6 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- run: sudo apt-get -y install libfontconfig1-dev
- run: sudo apt-get -y install libfontconfig1-dev llvm
- name: cargo test --features serde
run: |
cargo test -Zbuild-std --target x86_64-unknown-linux-gnu --features serde
env:
RUSTFLAGS: -Zsanitizer=address
LSAN_OPTIONS: report_objects=1
LSAN_OPTIONS: report_objects=1:suppressions=lsan_suppressions.txt

valgrind:
name: Valgrind
Expand Down
2 changes: 2 additions & 0 deletions lsan_suppressions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# fontconfig
leak:Fc
2 changes: 1 addition & 1 deletion mupdf-sys/mupdf
Submodule mupdf updated 288 files
2 changes: 1 addition & 1 deletion src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Font {
context(),
c_name.as_ptr(),
index,
buffer.into_inner()
buffer.inner
))
}
.map(|inner| Self { inner })
Expand Down
3 changes: 2 additions & 1 deletion src/stroke_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ impl StrokeState {
pub fn dashes(&self) -> Vec<f32> {
unsafe {
let dash_len = (*self.inner).dash_len as usize;
let dash_ptr = (*self.inner).dash_list.as_ptr();
let mut dash_list = Vec::with_capacity(dash_len);
dash_list.extend_from_slice(&(*self.inner).dash_list[0..dash_len]);
dash_list.extend_from_slice(std::slice::from_raw_parts(dash_ptr, dash_len));
dash_list
}
}
Expand Down