[vlc-devel] [PATCH] mediacodec: fix crash with --no-mediacodec-dr

Alexandre Janniaux ajanni at videolabs.io
Sun Jan 3 15:40:49 UTC 2021


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
---
 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];
--
2.30.0


More information about the vlc-devel mailing list