[vlc-commits] android/opaque: fix crash on Close with subtitles

Thomas Guillem git at videolan.org
Fri Oct 31 18:03:58 CET 2014


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Oct 31 17:17:23 2014 +0100| [0ba7c06e1088a9b3e2fddcdf5682cb38faa73b77] | committer: Jean-Baptiste Kempf

android/opaque: fix crash on Close with subtitles

The pixels allocated from picture_NewFromFormat were replaced (and leaked) by
pixels allocated by android native windows. This also leaded to a crash on
Close when subtitles_picture was freed.

Use picture_NewFromResource with an empty to resource in order to don't
allocate any pixels.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0ba7c06e1088a9b3e2fddcdf5682cb38faa73b77
---

 modules/video_output/android/opaque.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/android/opaque.c b/modules/video_output/android/opaque.c
index 6263b58..b301634 100644
--- a/modules/video_output/android/opaque.c
+++ b/modules/video_output/android/opaque.c
@@ -195,7 +195,9 @@ static int Open(vlc_object_t *p_this)
     video_format_t subpicture_format = sys->fmt;
     subpicture_format.i_chroma = VLC_CODEC_RGBA;
     /* Create a RGBA picture for rendering subtitles. */
-    sys->subtitles_picture = picture_NewFromFormat(&subpicture_format);
+    picture_resource_t rsc;
+    memset(&rsc, 0, sizeof(rsc));
+    sys->subtitles_picture = picture_NewFromResource(&subpicture_format, &rsc);
 
     /* Export the subpicture capability of this vout. */
     vd->info.subpicture_chromas = subpicture_chromas;



More information about the vlc-commits mailing list