Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
6e248545 by François Cartegnie at 2026-01-22T14:50:17+00:00
demux: es: fix swab usage

(cherry picked from commit bf4e354d6420cd09ac144d7ee2e5a6ee70c7bd33)

- - - - -


1 changed file:

- modules/demux/mpeg/es.c


Changes:

=====================================
modules/demux/mpeg/es.c
=====================================
@@ -499,10 +499,22 @@ static bool Parse( demux_t *p_demux, block_t **pp_output )
         if( p_sys->codec.b_use_word && !p_sys->b_big_endian && 
p_block_in->i_buffer > 0 )
         {
             /* Convert to big endian */
-            swab( p_block_in->p_buffer, p_block_in->p_buffer, 
p_block_in->i_buffer );
+            block_t *old = p_block_in;
+            p_block_in = block_Alloc( p_block_in->i_buffer );
+            if( p_block_in )
+            {
+                block_CopyProperties( p_block_in, old );
+                swab( old->p_buffer, p_block_in->p_buffer, old->i_buffer );
+            }
+            block_Release( old );
         }
 
-        p_block_in->i_pts = p_block_in->i_dts = p_sys->b_start || 
p_sys->b_initial_sync_failed ? VLC_TICK_0 : VLC_TICK_INVALID;
+        if( p_block_in )
+        {
+            p_block_in->i_pts =
+            p_block_in->i_dts = (p_sys->b_start || 
p_sys->b_initial_sync_failed) ?
+                                 VLC_TICK_0 : VLC_TICK_INVALID;
+        }
     }
     p_sys->b_initial_sync_failed = p_sys->b_start; /* Only try to resync once 
*/
 



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/6e248545a4940cda80b9d9b8e21d96c406f36553

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/6e248545a4940cda80b9d9b8e21d96c406f36553
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to