[vlc-commits] mediacodec: fix crash with --no-mediacodec-dr

Alexandre Janniaux git at videolan.org
Wed Jan 6 09:29:40 UTC 2021


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Sun Jan  3 16:23:24 2021 +0100| [337f0dff3534588e14bf397f9f0613ccd7277ae7] | committer: Alexandre Janniaux

mediacodec: fix crash with --no-mediacodec-dr

The android picture contexts are not initialized when mediacodec-dr has
been disabled, since it's done at the creation of the video context.
Since we don't have android picture, it's indeed expected that we don't
need to release their context.

Fix #24698

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

 modules/codec/omxil/mediacodec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index e5dae9343f..ebf3178b38 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -571,6 +571,10 @@ static void CleanFromVideoContext(void *priv)
 
 static void ReleaseAllPictureContexts(decoder_sys_t *p_sys)
 {
+    /* No picture context if no direct rendering. */
+    if (p_sys->video.ctx == NULL)
+        return;
+
     for (size_t i = 0; i < ARRAY_SIZE(p_sys->video.apic_ctxs); ++i)
     {
         struct android_picture_ctx *apctx = &p_sys->video.apic_ctxs[i];



More information about the vlc-commits mailing list