diff --git a/src/lib_ccx/ccx_decoders_common.c b/src/lib_ccx/ccx_decoders_common.c index db227f48..44b1b5cb 100644 --- a/src/lib_ccx/ccx_decoders_common.c +++ b/src/lib_ccx/ccx_decoders_common.c @@ -515,7 +515,6 @@ struct cc_subtitle* copy_subtitle(struct cc_subtitle *sub) if (sub->data) { - sub_copy->data = malloc(sizeof(struct eia608_screen)); sub_copy->data = malloc(sub->nb_data * sizeof(struct eia608_screen)); memcpy(sub_copy->data, sub->data, sub->nb_data * sizeof(struct eia608_screen)); } diff --git a/src/lib_ccx/ccx_encoders_srt.c b/src/lib_ccx/ccx_encoders_srt.c index c5f100ad..ff9e9227 100644 --- a/src/lib_ccx/ccx_encoders_srt.c +++ b/src/lib_ccx/ccx_encoders_srt.c @@ -130,8 +130,11 @@ int write_cc_bitmap_as_srt(struct cc_subtitle *sub, struct encoder_ctx *context) } for(i = 0, rect = sub->data; i < sub->nb_data; i++, rect++) { - freep(rect->data); - freep(rect->data+1); + if (rect) + { + freep(rect->data); + freep(rect->data+1); + } } #endif sub->nb_data = 0; diff --git a/src/lib_ccx/dvb_subtitle_decoder.c b/src/lib_ccx/dvb_subtitle_decoder.c index 3fd1f5f4..0da4d351 100644 --- a/src/lib_ccx/dvb_subtitle_decoder.c +++ b/src/lib_ccx/dvb_subtitle_decoder.c @@ -1536,6 +1536,8 @@ static int write_dvb_sub(struct lib_cc_decode *dec_ctx, struct cc_subtitle *sub) rect = malloc(sizeof(struct cc_bitmap)); if(!rect) return -1; + rect->data[0]=NULL; + rect->data[1]=NULL; sub->flags |= SUB_EOD_MARKER; sub->got_output = 1; diff --git a/src/lib_ccx/lib_ccx.c b/src/lib_ccx/lib_ccx.c index 372c65d3..4f03f2f5 100644 --- a/src/lib_ccx/lib_ccx.c +++ b/src/lib_ccx/lib_ccx.c @@ -288,6 +288,7 @@ struct lib_cc_decode *update_decoder_list(struct lib_ccx_ctx *ctx) { dec_ctx->prev = malloc(sizeof(struct lib_cc_decode)); dec_ctx->dec_sub.prev = malloc(sizeof(struct cc_subtitle)); + memset (dec_ctx->dec_sub.prev, 0,sizeof(struct cc_subtitle)); } } return dec_ctx; diff --git a/windows/README.TXT b/windows/README.TXT index 4881674a..8e51375e 100644 --- a/windows/README.TXT +++ b/windows/README.TXT @@ -1,6 +1,6 @@ The Windows binaries are now distributed separately, please visit -http://ccextractor.sourceforge.net +https://ccextractor.org/public:general:downloads For a link to the current version.