ccx_decoders_common.c: Removed trivial memory leak.

ccx_encoders_srt.c: Made sure a pointer is non-NULL before dereferencing.
dvb_subtitle_decoder.c: Initialize pointer members to NULL when creating a structure.
lib_ccx.c: Initialize (memset 0) structure cc_subtitle after memory allocation.
README.TXT: Removed reference to sourceforge.
This commit is contained in:
Carlos Fernandez
2018-02-21 20:31:09 +00:00
parent f85e65ba32
commit b1c00233b3
5 changed files with 9 additions and 4 deletions

View File

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

View File

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

View File

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

View File

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

View File

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