[libbluray-devel] Fix leaks
hpi1
git at videolan.org
Thu Jul 6 22:52:24 CEST 2017
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Jul 6 23:50:48 2017 +0300| [969487bf7a349defe411d36339ac40a808038738] | committer: hpi1
Fix leaks
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=969487bf7a349defe411d36339ac40a808038738
---
src/libbluray/bdnav/mpls_parse.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/libbluray/bdnav/mpls_parse.c b/src/libbluray/bdnav/mpls_parse.c
index 4e24c31c..05c79bef 100644
--- a/src/libbluray/bdnav/mpls_parse.c
+++ b/src/libbluray/bdnav/mpls_parse.c
@@ -386,12 +386,18 @@ _parse_stn(BITSTREAM *bits, MPLS_STN *stn)
static void
_clean_stn(MPLS_STN *stn)
{
+ unsigned ii;
+
if(stn->secondary_audio) {
- X_FREE(stn->secondary_audio->sa_primary_audio_ref);
+ for (ii = 0; ii < stn->num_secondary_audio; ii++) {
+ X_FREE(stn->secondary_audio[ii].sa_primary_audio_ref);
+ }
}
if(stn->secondary_video) {
- X_FREE(stn->secondary_video->sv_secondary_audio_ref);
- X_FREE(stn->secondary_video->sv_pip_pg_ref);
+ for (ii = 0; ii < stn->num_secondary_video; ii++) {
+ X_FREE(stn->secondary_video[ii].sv_secondary_audio_ref);
+ X_FREE(stn->secondary_video[ii].sv_pip_pg_ref);
+ }
}
X_FREE(stn->video);
More information about the libbluray-devel
mailing list