This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.1
in repository ffmpeg.

commit ba0d0bf542a2c1777c5dc92e4448e18999f0ab6f
Author:     Alex Vasilenko <[email protected]>
AuthorDate: Fri Oct 23 02:02:02 2026 +0000
Commit:     ffmpeg-devel <[email protected]>
CommitDate: Tue Nov 10 22:07:21 2026 +0000

    avutil/tests/encryption_info: make compare_encryption_init_info iterative
    
    Follow-up to 969c7eb09198, which replaced recursion with iteration in
    av_encryption_init_info_free() to avoid stack exhaustion on long init
    info lists. Replace the recursive call in compare_encryption_init_info()
    with an iterative loop as well so tests can compare deep lists without
    overflowing the stack.
    
    Signed-off-by: Marvin Scholz <[email protected]>
    (cherry picked from commit 273dfbb17df50c93f79313b48f0dc605455ca1aa)
---
 libavutil/tests/encryption_info.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/libavutil/tests/encryption_info.c 
b/libavutil/tests/encryption_info.c
index d8f0187ef9..84287a203a 100644
--- a/libavutil/tests/encryption_info.c
+++ b/libavutil/tests/encryption_info.c
@@ -47,28 +47,29 @@ static int compare_encryption_info(const AVEncryptionInfo 
*a, const AVEncryption
 }
 
 static int compare_encryption_init_info(const AVEncryptionInitInfo *a, const 
AVEncryptionInitInfo *b) {
-    if (!a || !b || a->system_id_size != b->system_id_size ||
-        a->num_key_ids != b->num_key_ids || a->key_id_size != b->key_id_size ||
-        a->data_size != b->data_size)
+    if (!a || !b)
         return 1;
 
-    if (memcmp(a->system_id, b->system_id, a->system_id_size) != 0 ||
-        memcmp(a->data, b->data, a->data_size) != 0)
-        return 1;
-
-    for (uint32_t i = 0; i < a->num_key_ids; i++) {
-        if (memcmp(a->key_ids[i], b->key_ids[i], a->key_id_size) != 0)
+    while (a && b) {
+        if (a->system_id_size != b->system_id_size ||
+            a->num_key_ids != b->num_key_ids || a->key_id_size != 
b->key_id_size ||
+            a->data_size != b->data_size)
             return 1;
-    }
 
-    if (a->next || b->next) {
-        if (!a->next || !b->next)
-            return 1;
-        if (compare_encryption_init_info(a->next, b->next) != 0)
+        if (memcmp(a->system_id, b->system_id, a->system_id_size) != 0 ||
+            memcmp(a->data, b->data, a->data_size) != 0)
             return 1;
+
+        for (uint32_t i = 0; i < a->num_key_ids; i++) {
+            if (memcmp(a->key_ids[i], b->key_ids[i], a->key_id_size) != 0)
+                return 1;
+        }
+
+        a = a->next;
+        b = b->next;
     }
 
-    return 0;
+    return a != b;
 }
 
 static void run_encryption_info_test(void)

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to