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

* Update general_loop.c

* Update general_loop.c

* Update CHANGES.TXT

* Update general_loop.c
This commit is contained in:
MakarovGCI2018 2018-12-02 22:48:18 +02:00 committed by Carlos Fernandez Sanz
parent 38fc6e5623
commit e3c14991b3
2 changed files with 12 additions and 5 deletions

View File

@ -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)
-----------------

View File

@ -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;
}
}