[med-svn] [Git][med-team/libvbz-hdf-plugin][master] fix-filter-buf-size.patch: new: fix VBZ read with HDF5 2.x
Andreas Tille (@tille)
gitlab at salsa.debian.org
Sun Oct 18 16:41:48 BST 2026
Andreas Tille pushed to branch master at Debian Med / libvbz-hdf-plugin
Commits:
357b9192 by Andreas Tille at 2026-10-18T17:30:24+02:00
fix-filter-buf-size.patch: new: fix VBZ read with HDF5 2.x
HDF5 2.x changed the filter callback ABI: on the reverse (decompress)
path *buf_size now holds the allocated buffer size, which may be larger
than the compressed chunk stored on disk, while the input size is passed
in nbytes. Use nbytes as the compressed input size, otherwise
vbz_decompress_sized() reads past the stored chunk and fails, making any
VBZ-compressed data unreadable (Closes: #1146006).
- - - - -
3 changed files:
- debian/changelog
- + debian/patches/fix-filter-buf-size.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -2,6 +2,10 @@ libvbz-hdf-plugin (1.0.13-2) UNRELEASED; urgency=medium
* d/watch: Use Dist in Gihub template
* Add autopkgtest
+ * fix-filter-buf-size.patch: new: use nbytes as compressed input size in
+ the HDF5 filter (HDF5 2.x changed the meaning of *buf_size on the
+ decompression path). Fixes reading VBZ compressed data with
+ HDF5 >= 2.x. (Affects: #1146006)
-- Andreas Tille <tille at debian.org> Mon, 14 Sep 2026 10:05:49 +0200
=====================================
debian/patches/fix-filter-buf-size.patch
=====================================
@@ -0,0 +1,48 @@
+Description: fix the HDF5 filter for the HDF5 2.x filter ABI
+ HDF5 2.x changed the semantics of the filter callback: on the reverse
+ (decompression) path the *buf_size parameter now holds the size of the
+ allocated chunk buffer, which can be larger than the compressed chunk
+ actually stored on disk, while the real input size is passed in nbytes.
+ The filter used *buf_size as the size of the compressed input, so it
+ read past the end of the stored chunk and vbz_decompress_sized() failed
+ with "vbz_filter: compression error" (observed as "Can't synchronously
+ read data" from h5py / HDF5). Use nbytes as the compressed input size
+ instead.
+ .
+ While here, also report the size of the produced buffer through *buf_size
+ in the decompression path (it was left at 0, only the return value was
+ used) and use the actual produced size in both directions.
+Author: Andreas Tille <tille at debian.org>
+Bug-Debian: https://bugs.debian.org/1146006
+Forwarded: https://github.com/nanoporetech/vbz_compression/issues
+Last-Update: 2026-10-18
+
+--- a/vbz_plugin/vbz_plugin.cpp
++++ b/vbz_plugin/vbz_plugin.cpp
+@@ -135,7 +135,7 @@
+ // If decompressing
+ if (flags & H5Z_FLAG_REVERSE)
+ {
+- auto input_span = gsl::make_span(static_cast<char*>(*buf), *buf_size);
++ auto input_span = gsl::make_span(static_cast<char*>(*buf), nbytes);
+ if (input_span.size() > std::numeric_limits<vbz_size_t>::max())
+ {
+ std::cerr << "vbz_filter: Chunk size too large." << std::endl;
+@@ -175,6 +175,8 @@
+ return 0;
+ }
+
++ *buf_size = outbuf_used_size;
++
+ #if VBZ_DEBUG
+ std::cout << "Decompressed dataset from " << *buf_size << " bytes to " << outbuf_used_size
+ << " with checksum " << checksum(gsl::make_span(static_cast<char*>(outbuf.get()), outbuf_used_size)) << std::endl;
+@@ -224,7 +226,7 @@
+
+ h5_free(*buf);
+ *buf = outbuf.release();
+- *buf_size = outbuf_size;
++ *buf_size = outbuf_used_size;
+ return outbuf_used_size;
+ }
+
=====================================
debian/patches/series
=====================================
@@ -2,3 +2,4 @@ use-packaged-streamvbyte.patch
fix-install-location.patch
soversion.patch
gcc-13.patch
+fix-filter-buf-size.patch
View it on GitLab: https://salsa.debian.org/med-team/libvbz-hdf-plugin/-/commit/357b9192ee2af156cf09ed584cdf5439210508a5
--
View it on GitLab: https://salsa.debian.org/med-team/libvbz-hdf-plugin/-/commit/357b9192ee2af156cf09ed584cdf5439210508a5
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20261018/ad63eb21/attachment-0001.htm>
More information about the debian-med-commit
mailing list