Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
32705bd3 by Francois Cartegnie at 2023-04-05T05:45:30+00:00
demux: avi: fix unwanted padding in odd sized samples

regression by c8fe3d812c277821ade872e334e78acc19deaf03

- - - - -


1 changed file:

- modules/demux/avi/avi.c


Changes:

=====================================
modules/demux/avi/avi.c
=====================================
@@ -850,7 +850,7 @@ error:
  *****************************************************************************/
 
 static block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
-                            uint32_t i_header, uint32_t i_size )
+                            uint32_t i_header, uint32_t i_osize )
 {
     /* skip header */
     if( i_header )
@@ -862,7 +862,7 @@ static block_t * ReadFrame( demux_t *p_demux, const 
avi_track_t *tk,
     }
 
     /* read size padded on word boundary */
-    i_size = __EVEN(i_size);
+    uint32_t i_size = __EVEN(i_osize);
 
     if( i_size == 0 )
         return block_Alloc(0); /* vlc_stream_Block can't read/alloc 0 sized */
@@ -871,6 +871,9 @@ static block_t * ReadFrame( demux_t *p_demux, const 
avi_track_t *tk,
     if ( !p_frame )
         return p_frame;
 
+    if( i_osize == i_size - 1 )
+        p_frame->i_buffer--;
+
     if( tk->bihprops.i_stride > INT32_MAX - 3 )
     {
         p_frame->i_buffer = 0;



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/32705bd3675e8fb87eb3c5d827f91a5ae8d0bc3f

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


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to