summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-09-13 20:13:59 +0000
committerjstebbins <[email protected]>2012-09-13 20:13:59 +0000
commit8329bf01460521587889fd4133f76b32ccf13217 (patch)
treec0758b2c843c05b03ab1ad93857c6045ad7c0a91 /libhb/stream.c
parentae8dee43bbcd12b5a4a532c7f4f65bf912479428 (diff)
libhb: fix a collection of small memory leaks
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4963 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/stream.c')
-rw-r--r--libhb/stream.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libhb/stream.c b/libhb/stream.c
index 4dd4a4e2a..ede9f33d3 100644
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -4365,13 +4365,19 @@ static void hb_ts_resolve_pid_types(hb_stream_t *stream)
total_size += buf->size;
if ( total_size > HB_MAX_PROBE_SIZE * 2 )
+ {
+ hb_buffer_close(&buf);
break;
+ }
int idx;
idx = index_of_id( stream, buf->s.id );
if (idx < 0 || stream->pes.list[idx].stream_kind != U )
+ {
+ hb_buffer_close(&buf);
continue;
+ }
hb_pes_stream_t *pes = &stream->pes.list[idx];
@@ -4389,6 +4395,7 @@ static void hb_ts_resolve_pid_types(hb_stream_t *stream)
pes->codec_name, pes->stream_id, pes->stream_id_ext);
}
}
+ hb_buffer_close(&buf);
}
// Clean up any probe buffers and set all remaining unknown
// streams to 'kind' N