lua: don't use | operator on VLC errors
authorSteve Lhomme <robux4@ycbcr.xyz>
Wed, 18 Sep 2024 10:57:04 +0000 (12:57 +0200)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 21 Jan 2025 18:02:47 +0000 (19:02 +0100)
This could end up with unknown/invalid error values.

(cherry picked from commit 586b28f4aab1f936d666bd3dab7904793c3012d7)

Gbp-Pq: Name 0056-lua-don-t-use-operator-on-VLC-errors.patch

modules/lua/extension.c

index cc6bffc8651908d2be80de2846f6b6eef229ca27..c8bfe223a32b069ce0d0f66b344b8025eab697f1 100644 (file)
@@ -971,7 +971,10 @@ int lua_ExecuteFunctionVa( extensions_manager_t *p_mgr, extension_t *p_ext,
         i_ret = VLC_EGENERIC;
     }
 
-    i_ret |= lua_DialogFlush( L );
+    if (i_ret != VLC_SUCCESS)
+        lua_DialogFlush( L );
+    else
+        i_ret = lua_DialogFlush( L );
 
 exit:
     return i_ret;
@@ -1013,7 +1016,10 @@ int lua_ExtensionTriggerMenu( extensions_manager_t *p_mgr,
         i_ret = VLC_EGENERIC;
     }
 
-    i_ret |= lua_DialogFlush( L );
+    if (i_ret != VLC_SUCCESS)
+        lua_DialogFlush( L );
+    else
+        i_ret = lua_DialogFlush( L );
     if( i_ret < VLC_SUCCESS )
     {
         msg_Dbg( p_mgr, "Something went wrong in %s (%s:%d)",