diff options
author | John Stebbins <[email protected]> | 2016-04-20 14:20:18 -0600 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-04-20 14:20:45 -0600 |
commit | 8955465161ea109dee0766539396e4b7b1ef0983 (patch) | |
tree | 40689f13d1a44432fc28818355cf01758ff6ebb0 /libhb/stream.c | |
parent | 451a424c78a291bb9cc48667990edfd31ed6e3ac (diff) |
stream: fix memory leak during PS stream probe
Diffstat (limited to 'libhb/stream.c')
-rw-r--r-- | libhb/stream.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libhb/stream.c b/libhb/stream.c index 37edd62d3..5fa0dda43 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -4340,13 +4340,19 @@ static void hb_ps_resolve_stream_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]; @@ -4364,6 +4370,7 @@ static void hb_ps_resolve_stream_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 |