Carry a truncated JOC payload as an invalid frame status
A real E-AC-3 JOC stream can carry an ID14 payload that ends inside joc_data: the header, clipgain, sequence counter and object parameters are complete, only the per-object matrices are missing. That frame used to abort the stream with JOC_ERR_BITSTREAM_TRUNCATED. The overrun is now classified as JOC_FRAME_STATUS_TRUNCATED (7) and the renderer takes its existing invalid-frame path, so it holds the previous matrices and playback continues; the damaged frame stays visible in the stream's truncated_joc_frames counter and the file task's warning. A payload too short for the 12-bit joc_header, a container length past the syncframe and a Huffman walk leaving the tree stay fatal, the strict padding checker still reports the truncation, and container scoring no longer prefers such a payload. The stream status struct grows by one appended field and joc_stream_status() accepts the previous size as well. Bump the version to 1.3.0.
This commit is contained in:
1 parent
3f0d5e87fe
commit
abce8465f8
12 files changed
+309
-37
No files matched your search
@@ -1,3 +1,4 @@
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
@@ -140,8 +141,13 @@ joc_error JOC_CALL joc_stream_reset(joc_stream* stream) {
|
||||
}
|
||||
|
||||
joc_error JOC_CALL joc_stream_status(const joc_stream* stream, joc_stream_status_info* out) {
|
||||
// The info struct only grows by appending fields, so a caller built against
|
||||
// the previous size still gets every field it knows about.
|
||||
constexpr uint32_t kSizeBeforeTruncatedFrames = static_cast<uint32_t>(
|
||||
offsetof(joc_stream_status_info, truncated_joc_frames));
|
||||
if (stream == nullptr || out == nullptr ||
|
||||
out->struct_size != sizeof(joc_stream_status_info)) {
|
||||
(out->struct_size != sizeof(joc_stream_status_info) &&
|
||||
out->struct_size != kSizeBeforeTruncatedFrames)) {
|
||||
return JOC_ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
const joc::stream::Info& info = stream->instance.info();
|
||||
@@ -160,6 +166,9 @@ joc_error JOC_CALL joc_stream_status(const joc_stream* stream, joc_stream_status
|
||||
out->bed_mask_mismatch_frames = info.bed_mask_mismatch_frames;
|
||||
out->output_channels = info.output_channels;
|
||||
out->ended = info.ended;
|
||||
if (out->struct_size > kSizeBeforeTruncatedFrames) {
|
||||
out->truncated_joc_frames = info.truncated_joc_frames;
|
||||
}
|
||||
return JOC_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user