@@ -94,7 +94,7 @@ static const char *webvtt_inline_css = "\r\nSTYLE\n\n"
9494 " background-color: rgba(255, 255, 255, 0.5);\n"
9595 "}\n"
9696 "::cue(c.bg_green.bg_semi-transparent) {\n"
97- " background-color: rgba(0, 256 , 0, 0.5);\n"
97+ " background-color: rgba(0, 255 , 0, 0.5);\n"
9898 "}\n"
9999 "::cue(c.bg_blue.bg_semi-transparent) {\n"
100100 " background-color: rgba(0, 0, 255, 0.5);\n"
@@ -189,6 +189,7 @@ int write_stringz_as_webvtt(char *string, struct encoder_ctx *context, LLONG ms_
189189 if (written != context -> encoded_crlf_length )
190190 {
191191 free (el );
192+ free (unescaped );
192193 return -1 ;
193194 }
194195 begin += strlen ((const char * )begin ) + 1 ;
@@ -502,16 +503,16 @@ int write_cc_buffer_as_webvtt(struct eia608_screen *data, struct encoder_ctx *co
502503 if (open_font != FONT_REGULAR )
503504 {
504505 if (open_font & FONT_ITALICS )
505- write_wrapped (context -> out -> fh , strdup ( "<i>" ) , 3 );
506+ write_wrapped (context -> out -> fh , "<i>" , 3 );
506507 if (open_font & FONT_UNDERLINED )
507- write_wrapped (context -> out -> fh , strdup ( "<u>" ) , 3 );
508+ write_wrapped (context -> out -> fh , "<u>" , 3 );
508509 }
509510
510511 // opening events for colors
511512 int open_color = color_events [j ] & 0xFF ; // Last 16 bytes
512513 if (open_color != COL_WHITE )
513514 {
514- write_wrapped (context -> out -> fh , strdup ( "<c." ) , 3 );
515+ write_wrapped (context -> out -> fh , "<c." , 3 );
515516 write_wrapped (context -> out -> fh , color_text [open_color ][0 ], strlen (color_text [open_color ][0 ]));
516517 write_wrapped (context -> out -> fh , ">" , 1 );
517518 }
@@ -532,17 +533,17 @@ int write_cc_buffer_as_webvtt(struct eia608_screen *data, struct encoder_ctx *co
532533 int close_color = color_events [j ] >> 16 ; // First 16 bytes
533534 if (close_color != COL_WHITE )
534535 {
535- write_wrapped (context -> out -> fh , strdup ( "</c>" ) , 4 );
536+ write_wrapped (context -> out -> fh , "</c>" , 4 );
536537 }
537538
538539 // closing events for fonts
539540 int close_font = font_events [j ] >> 16 ; // First 16 bytes
540541 if (close_font != FONT_REGULAR )
541542 {
542543 if (close_font & FONT_UNDERLINED )
543- write_wrapped (context -> out -> fh , strdup ( "</u>" ) , 4 );
544+ write_wrapped (context -> out -> fh , "</u>" , 4 );
544545 if (close_font & FONT_ITALICS )
545- write_wrapped (context -> out -> fh , strdup ( "</i>" ) , 4 );
546+ write_wrapped (context -> out -> fh , "</i>" , 4 );
546547 }
547548 }
548549 }
0 commit comments