summaryrefslogtreecommitdiffstats
path: root/libhb/muxmkv.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-05-01 11:23:36 +0000
committerjstebbins <[email protected]>2012-05-01 11:23:36 +0000
commitdf3daf7cdd85794ef3d7f0eff181eb3b323a489f (patch)
treebb7e5295a613949f3b556d7baf5a43b387b551f6 /libhb/muxmkv.c
parent2e8be70b9910c62d8d8cb693f8c58485efbf4e97 (diff)
merge assorted fixes provided by Rogerio Brito
Pretty much all resource cleanup issues on error condition handling. Thanks Rogerio! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4620 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/muxmkv.c')
-rw-r--r--libhb/muxmkv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libhb/muxmkv.c b/libhb/muxmkv.c
index 1140bc5b0..227159579 100644
--- a/libhb/muxmkv.c
+++ b/libhb/muxmkv.c
@@ -77,6 +77,7 @@ static int MKVInit( hb_mux_object_t * m )
hb_error( "Could not create output file, Disk Full?" );
job->mux_data = NULL;
*job->die = 1;
+ free(track);
return 0;
}
@@ -94,8 +95,10 @@ static int MKVInit( hb_mux_object_t * m )
/* Taken from x264 muxers.c */
avcC_len = 5 + 1 + 2 + job->config.h264.sps_length + 1 + 2 + job->config.h264.pps_length;
avcC = malloc(avcC_len);
- if (avcC == NULL)
+ if (avcC == NULL) {
+ free(track);
return -1;
+ }
avcC[0] = 1;
avcC[1] = job->config.h264.sps[1]; /* AVCProfileIndication */
@@ -158,6 +161,7 @@ static int MKVInit( hb_mux_object_t * m )
default:
*job->die = 1;
hb_error("muxmkv: Unknown video codec: %x", job->vcodec);
+ free(track);
return 0;
}