Permalink
Browse files

[FIX] Fixed /dev/null bug (#1048)

* Update general_loop.c

* Update general_loop.c

* Update CHANGES.TXT

* Update general_loop.c
  • Loading branch information...
MakarovGCI2018 authored and cfsmp3 committed Dec 2, 2018
1 parent 38fc6e5 commit e3c14991b3a217442acb1142eaa00421be194fff
Showing with 12 additions and 5 deletions.
  1. +1 −0 docs/CHANGES.TXT
  2. +11 −5 src/lib_ccx/general_loop.c
@@ -4,6 +4,7 @@
- Optimize: Remove multiple RGB to grey conversion in OCR.
- Fix: Update UTF8Proc to 2.2.0
- Fix: Warn instead of fatal when a 0xFF marker is missing
- Fix: Segfault in general_loop.c because of enc_ctx is NULL pointer

0.87 (2018-10-23)
-----------------
@@ -1025,14 +1025,17 @@ int general_loop(struct lib_ccx_ctx *ctx)
if (data_node->bufferdatatype == CCX_TELETEXT && dec_ctx->private_data) //if we have teletext subs, we set the min_pts here
set_tlt_delta(dec_ctx, min_pts);
ret = process_data(enc_ctx, dec_ctx, data_node);
if (enc_ctx->srt_counter || enc_ctx->cea_708_counter || dec_ctx->saw_caption_block || ret == 1)
caps = 1;
if (enc_ctx != NULL) {
if (enc_ctx->srt_counter || enc_ctx->cea_708_counter || dec_ctx->saw_caption_block || ret == 1)
caps = 1;
}

// Process the last subtitle for DVB
if (!(!terminate_asap && !end_of_file && is_decoder_processed_enough(ctx) == CCX_FALSE)) {
if (data_node->bufferdatatype == CCX_DVB_SUBTITLE && dec_ctx->dec_sub.prev->end_time == 0) {
dec_ctx->dec_sub.prev->end_time = (dec_ctx->timing->current_pts - dec_ctx->timing->min_pts) / (MPEG_CLOCK_FREQ / 1000);
encode_sub(enc_ctx->prev, dec_ctx->dec_sub.prev);
if (enc_ctx != NULL)
encode_sub(enc_ctx->prev, dec_ctx->dec_sub.prev);
dec_ctx->dec_sub.prev->got_output = 0;
}
}
@@ -1104,16 +1107,19 @@ int general_loop(struct lib_ccx_ctx *ctx)
set_current_pts(dec_ctx->timing, data_node->pts);

ret = process_data(enc_ctx, dec_ctx, data_node);
if (
if (enc_ctx != NULL){
if (
(enc_ctx && (enc_ctx->srt_counter || enc_ctx->cea_708_counter) ||
dec_ctx->saw_caption_block || ret == 1)
)
caps = 1;
}
// Process the last subtitle for DVB
if (!(!terminate_asap && !end_of_file && is_decoder_processed_enough(ctx) == CCX_FALSE)) {
if (data_node->bufferdatatype == CCX_DVB_SUBTITLE && dec_ctx && dec_ctx->dec_sub.prev && dec_ctx->dec_sub.prev->end_time == 0) {
dec_ctx->dec_sub.prev->end_time = (dec_ctx->timing->current_pts - dec_ctx->timing->min_pts) / (MPEG_CLOCK_FREQ / 1000);
encode_sub(enc_ctx->prev, dec_ctx->dec_sub.prev);
if (enc_ctx != NULL)
encode_sub(enc_ctx->prev, dec_ctx->dec_sub.prev);
dec_ctx->dec_sub.prev->got_output = 0;
}
}

0 comments on commit e3c1499

Please sign in to comment.