From 1807ea909888db211cec4d35ade6a196f371f2f2 Mon Sep 17 00:00:00 2001 From: Matej Plavevski Date: Fri, 2 Nov 2018 01:07:53 +0100 Subject: [PATCH] [IMPROVEMENT] Warn instead of Crash for Missing Final 0xFF Marker! (#1032) * Less Harsher when Marker is missing * Update changelog * Skip Block by breaking * Reference GitHub issue * Forgot {} * Update docs/CHANGES.TXT Co-Authored-By: MatejMecka --- docs/CHANGES.TXT | 1 + src/lib_ccx/avc_functions.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/CHANGES.TXT b/docs/CHANGES.TXT index e54ead8d..30579f4c 100644 --- a/docs/CHANGES.TXT +++ b/docs/CHANGES.TXT @@ -1,6 +1,7 @@ 0.88(2018-10-24) (unreleased) ----------------- - Fix: Update UTF8Proc to 2.2.0 +- Fix: Warn instead of fatal when a 0xFF marker is missing 0.87 (2018-10-23) ----------------- diff --git a/src/lib_ccx/avc_functions.c b/src/lib_ccx/avc_functions.c index aad71969..4254dda8 100644 --- a/src/lib_ccx/avc_functions.c +++ b/src/lib_ccx/avc_functions.c @@ -500,10 +500,11 @@ void user_data_registered_itu_t_t35 (struct avc_ctx *ctx, unsigned char *userbuf if (cc_tmp_data+local_cc_count*3 >= userend) fatal(CCX_COMMON_EXIT_BUG_BUG, "Syntax problem: Too many caption blocks."); - if (cc_tmp_data[local_cc_count*3]!=0xFF) - fatal(CCX_COMMON_EXIT_BUG_BUG, - "Syntax problem: Final 0xFF marker missing."); - + if (cc_tmp_data[local_cc_count*3]!=0xFF){ + // See GitHub Issue #1001 for the related change + mprint ("\rWarning! Syntax problem: Final 0xFF marker missing. Continuing...\n"); + break; // Skip Block + } // Save the data and process once we know the sequence number if ( ( (ctx->cc_count + local_cc_count) * 3) + 1 > ctx->cc_databufsize) {