Warning, /graphics/krita/3rdparty/ext_mlt/0002-MLT-check-pointers-before-dereferencing.patch is written in an unsupported language. File is not indexed.

0001 From 4a6944fd0e7164d77eddca22f9d703ce2533611e Mon Sep 17 00:00:00 2001
0002 From: Halla Rempt <halla@valdyas.org>
0003 Date: Fri, 26 Jan 2024 20:03:28 +0100
0004 Subject: [PATCH 2/2] MLT: check pointers before dereferencing
0005 
0006 In other places, checks for "self" occur as well, so it probably
0007 should be checked everywhere.
0008 
0009 This prevents MLT from crashing if it cannot find plugins on creating
0010 an image in Krita. It's still not good that MLT cannot find plugins
0011 in a reliable way, though...
0012 ---
0013  src/framework/mlt_consumer.c | 2 ++
0014  src/framework/mlt_service.c  | 4 +++-
0015  2 files changed, 5 insertions(+), 1 deletion(-)
0016 
0017 diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c
0018 index a65d7c81..00c125a9 100644
0019 --- a/src/framework/mlt_consumer.c
0020 +++ b/src/framework/mlt_consumer.c
0021 @@ -578,6 +578,8 @@ int mlt_consumer_put_frame(mlt_consumer self, mlt_frame frame)
0022  {
0023      int error = 1;
0024  
0025 +    if (!self) return error;
0026 +
0027      // Get the service associated to the consumer
0028      mlt_service service = MLT_CONSUMER_SERVICE(self);
0029  
0030 diff --git a/src/framework/mlt_service.c b/src/framework/mlt_service.c
0031 index 4ee83fa5..f2e42331 100644
0032 --- a/src/framework/mlt_service.c
0033 +++ b/src/framework/mlt_service.c
0034 @@ -319,9 +319,11 @@ int mlt_service_insert_producer(mlt_service self, mlt_service producer, int inde
0035  
0036  int mlt_service_disconnect_producer(mlt_service self, int index)
0037  {
0038 +    if (!self) return -1;
0039 +
0040      mlt_service_base *base = self->local;
0041  
0042 -    if (base->in && index >= 0 && index < base->count) {
0043 +    if (base && base->in && index >= 0 && index < base->count) {
0044          mlt_service current = base->in[index];
0045  
0046          if (current) {
0047 -- 
0048 2.23.0.windows.1
0049