mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-05 21:51:23 +00:00
fix(report): NULL guard and deduplicate call in teletext JSON report
Follow-up to #2137: - Add NULL check on private_data in tlt_print_seen_pages_json - Remove duplicate get_sib_stream_by_type call in print_file_report_json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -523,9 +523,9 @@ void print_file_report_json(struct lib_ccx_ctx *ctx)
|
||||
printf(" },\n");
|
||||
|
||||
/* Teletext seen pages */
|
||||
if (program_ci && get_sib_stream_by_type(program_ci, CCX_CODEC_TELETEXT))
|
||||
struct cap_info *tlt_info = program_ci ? get_sib_stream_by_type(program_ci, CCX_CODEC_TELETEXT) : NULL;
|
||||
if (tlt_info)
|
||||
{
|
||||
struct cap_info *tlt_info = get_sib_stream_by_type(program_ci, CCX_CODEC_TELETEXT);
|
||||
struct lib_cc_decode *tlt_dec = update_decoder_list_cinfo(ctx, tlt_info);
|
||||
if (tlt_dec && tlt_dec->codec == CCX_CODEC_TELETEXT)
|
||||
{
|
||||
|
||||
@@ -1369,6 +1369,11 @@ int tlt_print_seen_pages_json(struct lib_cc_decode *dec_ctx)
|
||||
}
|
||||
|
||||
ctx = dec_ctx->private_data;
|
||||
if (!ctx)
|
||||
{
|
||||
printf("[]");
|
||||
return CCX_OK;
|
||||
}
|
||||
|
||||
printf("[");
|
||||
int first = 1;
|
||||
|
||||
Reference in New Issue
Block a user