Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
cd3ed403
Commit
cd3ed403
authored
Nov 14, 2014
by
Thomas Guillem
Committed by
Jean-Baptiste Kempf
Nov 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
android/surface: fix leaks if Open fails
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
07063204
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
modules/video_output/android/surface.c
modules/video_output/android/surface.c
+17
-14
No files found.
modules/video_output/android/surface.c
View file @
cd3ed403
...
...
@@ -183,6 +183,8 @@ static int Open(vlc_object_t *p_this)
/* Allocate structure */
vout_display_sys_t
*
sys
=
(
struct
vout_display_sys_t
*
)
calloc
(
1
,
sizeof
(
*
sys
));
if
(
!
sys
)
goto
error
;
/* */
sys
->
p_library
=
LoadNativeWindowAPI
(
&
sys
->
native_window
);
...
...
@@ -190,9 +192,8 @@ static int Open(vlc_object_t *p_this)
if
(
!
sys
->
p_library
)
sys
->
p_library
=
InitLibrary
(
sys
);
if
(
!
sys
->
p_library
)
{
free
(
sys
);
msg_Err
(
vd
,
"Could not initialize libandroid.so/libui.so/libgui.so/libsurfaceflinger_client.so!"
);
return
VLC_EGENERIC
;
goto
error
;
}
/* Setup chroma */
...
...
@@ -234,14 +235,14 @@ static int Open(vlc_object_t *p_this)
/* Create the associated picture */
picture_sys_t
*
picsys
=
malloc
(
sizeof
(
*
picsys
));
if
(
unlikely
(
picsys
==
NULL
))
goto
e
nomem
;
goto
e
rror
;
picsys
->
sys
=
sys
;
picture_resource_t
resource
=
{
.
p_sys
=
picsys
};
picture_t
*
picture
=
picture_NewFromResource
(
&
fmt
,
&
resource
);
if
(
!
picture
)
{
free
(
picsys
);
goto
e
nomem
;
goto
e
rror
;
}
/* Wrap it into a picture pool */
...
...
@@ -255,7 +256,7 @@ static int Open(vlc_object_t *p_this)
sys
->
pool
=
picture_pool_NewExtended
(
&
pool_cfg
);
if
(
!
sys
->
pool
)
{
picture_Release
(
picture
);
goto
e
nomem
;
goto
e
rror
;
}
/* Setup vout_display */
...
...
@@ -275,10 +276,8 @@ static int Open(vlc_object_t *p_this)
return
VLC_SUCCESS
;
enomem:
dlclose
(
sys
->
p_library
);
free
(
sys
);
vlc_mutex_unlock
(
&
single_instance
);
error:
Close
(
p_this
);
return
VLC_ENOMEM
;
}
...
...
@@ -287,11 +286,15 @@ static void Close(vlc_object_t *p_this)
vout_display_t
*
vd
=
(
vout_display_t
*
)
p_this
;
vout_display_sys_t
*
sys
=
vd
->
sys
;
picture_pool_Release
(
sys
->
pool
);
if
(
sys
->
window
)
sys
->
native_window
.
winRelease
(
sys
->
window
);
dlclose
(
sys
->
p_library
);
free
(
sys
);
if
(
sys
)
{
if
(
sys
->
pool
)
picture_pool_Release
(
sys
->
pool
);
if
(
sys
->
window
)
sys
->
native_window
.
winRelease
(
sys
->
window
);
if
(
sys
->
p_library
)
dlclose
(
sys
->
p_library
);
free
(
sys
);
}
}
static
picture_pool_t
*
Pool
(
vout_display_t
*
vd
,
unsigned
count
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment