mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-23 16:16:25 +00:00
Currently, the typefind logic for cdg can cause errors on files with all conditions below: - size multiple of NB_WINDOWS * CDG_PACKET_SIZE (8 * 24) = 192 - size less than TYPEFIND_SEARCH_WINDOW (28800) - extension different than .cdg With those conditions, the cdg typefind function may be the last one to execute and cause gsttypefindhelper.c::helper_find_peek to return GST_FLOW_EOS, and if it's the final call will then be turned to GST_FLOW_ERROR in typefind. That is because cdg's typefind will perform a last call to typefind.peek(len, CDG_PACKET_SIZE) which is outside the range of typefind (from 0 to len - 1). Reproducer with file from cdg tests: ``` head -n 28608 BrotherJohn.cdg > BrotherJohn_short.bit gst-play-1.0 BrotherJohn_short.bit ``` Fix this by correcting the loop bounds in the cdg typefind logic. Perhaps the typefind helper logic should be rewritten to avoid such cases too. Then the example above works and unrelated files aren't affected by this in typefind anymore. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2059> |
||
---|---|---|
.. | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT |