[vlc-commits] [Git][videolan/vlc][3.0.x] demux: h26x: fix vlc_stream_Peek() read into an unsigned value
Steve Lhomme (@robUx4)
gitlab at videolan.org
Mon Dec 22 10:25:39 UTC 2025
Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC
Commits:
b7c75b0c by Steve Lhomme at 2025-12-22T10:11:14+00:00
demux: h26x: fix vlc_stream_Peek() read into an unsigned value
We need to check errors in vlc_stream_Peek() calls.
(cherry picked from commit 1558850135d43cf8fe5a500f31d9250410ee6359)
- - - - -
1 changed file:
- modules/demux/mpeg/h26x.c
Changes:
=====================================
modules/demux/mpeg/h26x.c
=====================================
@@ -271,9 +271,9 @@ static int GenericOpen( demux_t *p_demux, const char *psz_module,
if( vlc_stream_Peek( p_demux->s, &p_peek, H26X_MIN_PEEK ) == H26X_MIN_PEEK &&
!memcmp( p_peek, annexb_startcode, 4 ) )
{
- size_t i_peek = H26X_MIN_PEEK;
+ ssize_t i_peek = H26X_MIN_PEEK;
size_t i_peek_target = H26X_MIN_PEEK;
- size_t i_probe_offset = 4;
+ ssize_t i_probe_offset = 4;
const uint8_t *p_probe = p_peek;
bool b_synced = true;
unsigned i_bitflow = 0;
@@ -304,7 +304,7 @@ static int GenericOpen( demux_t *p_demux, const char *psz_module,
if( b_synced )
{
p_probe = &p_peek[i_probe_offset];
- i_ret = pf_probe( p_probe, i_peek - i_probe_offset, p_ctx );
+ i_ret = pf_probe( p_probe, (size_t)(i_peek - i_probe_offset), p_ctx );
}
if( i_ret != 0 )
@@ -525,4 +525,3 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
0, -1,
0, 1, i_query, args );
}
-
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b7c75b0c9925847518913a946bc25516e9885ab4
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b7c75b0c9925847518913a946bc25516e9885ab4
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