changeset 35341:34c05e3ea263

Fix leaks in case of overflow.
author upsuper
date Wed, 21 Nov 2012 11:15:38 +0000
parents d5476d0811f8
children 6d9e9c6d3cab
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Tue Nov 20 22:25:04 2012 +0000
+++ b/libmpdemux/demux_mkv.c	Wed Nov 21 11:15:38 2012 +0000
@@ -1546,6 +1546,7 @@
             cnt = track->private_size - RVPROPERTIES_SIZE;
             if (cnt > INT_MAX - sizeof(*bih) - 8) {
                 mp_msg(MSGT_DEMUX, MSGL_ERR, "[mkv] Integer overflow!\n");
+                free(bih);
                 return 1;
             }
             bih = realloc(bih, sizeof(*bih) + 8 + cnt);