From 335bca450795e2893f12f5509935715e50c6fec2 Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari Date: Mon, 28 Jul 2014 17:48:25 +0200 Subject: [PATCH] uninitialized values used in encoder --- src/cc_encoders_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc_encoders_common.c b/src/cc_encoders_common.c index 8e336a7d..0fa3c99e 100644 --- a/src/cc_encoders_common.c +++ b/src/cc_encoders_common.c @@ -378,7 +378,7 @@ int encode_sub(struct encoder_ctx *context, struct cc_subtitle *sub) if (ccx_options.gui_mode_reports) write_cc_buffer_to_gui(sub->data, context); } - - freep(&sub->data); + if (!sub->nb_data) + freep(&sub->data); return wrote_something; }