[vlc-commits] [Git][videolan/vlc][master] 2 commits: demux: mp3: fix logic for using xing duration

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat May 27 10:23:41 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
ab93e501 by Francois Cartegnie at 2023-05-27T09:57:52+00:00
demux: mp3: fix logic for using xing duration

refs #28166

- - - - -
ab6009c5 by Francois Cartegnie at 2023-05-27T09:57:52+00:00
demux: mp3: fix Lame bitrate mode offset

refs #28166

- - - - -


1 changed file:

- modules/demux/mpeg/es.c


Changes:

=====================================
modules/demux/mpeg/es.c
=====================================
@@ -229,7 +229,7 @@ static int ParseXing( const uint8_t *p_buf, size_t i_buf, struct xing_info_s *xi
         xing->encoder != VLC_FOURCC('L','a','v','f') )
         return VLC_SUCCESS;
 
-    xing->brmode  = p_fixed[8] & 0x0f; /* version upper / mode lower */
+    xing->brmode  = p_fixed[9] & 0x0f; /* version upper / mode lower */
     uint32_t peak_signal  = GetDWBE( &p_fixed[11] );
     xing->f_peak_signal = peak_signal / 8388608.0; /* pow(2, 23) */
     uint16_t gain = GetWBE( &p_fixed[15] );
@@ -1392,7 +1392,8 @@ static int MpgaInit( demux_t *p_demux )
                or if we verified the file isn't truncated */
             if( xing->i_bytes == 0 ||
                 vlc_stream_GetSize( p_demux->s, &i_stream_size ) ||
-                i_stream_size >= xing->i_bytes + p_sys->mpgah.i_frame_size )
+               (i_stream_size >= xing->i_bytes &&
+                i_stream_size <= xing->i_bytes + p_sys->mpgah.i_frame_size) )
             {
                 p_sys->i_duration = vlc_tick_from_samples( i_total_samples - i_dropped_samples,
                                                            p_sys->mpgah.i_sample_rate );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d467e95c659d5d61de56679ea18030857def17f0...ab6009c59e6e7d0ad140cd4a3c1443ab46527a4e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d467e95c659d5d61de56679ea18030857def17f0...ab6009c59e6e7d0ad140cd4a3c1443ab46527a4e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list