Commit f54f04d0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

demux: check stream_Read() (probably fixes #12276)

stream_Read() can always fail.

(cherry picked from commit ddcf5d1ce2904f2975d0b7f7b236454fd7bc41f5)
parent c0d29437
...@@ -398,7 +398,8 @@ static bool SkipID3Tag( demux_t *p_demux ) ...@@ -398,7 +398,8 @@ static bool SkipID3Tag( demux_t *p_demux )
i_size += 10; i_size += 10;
/* Skip the entire tag */ /* Skip the entire tag */
stream_Read( p_demux->s, NULL, i_size ); if( stream_Read( p_demux->s, NULL, i_size ) < i_size )
return false;
msg_Dbg( p_demux, "ID3v2.%d revision %d tag found, skipping %d bytes", msg_Dbg( p_demux, "ID3v2.%d revision %d tag found, skipping %d bytes",
version, revision, i_size ); version, revision, i_size );
...@@ -429,7 +430,8 @@ static bool SkipAPETag( demux_t *p_demux ) ...@@ -429,7 +430,8 @@ static bool SkipAPETag( demux_t *p_demux )
i_size = GetDWLE( &p_peek[8+4] ) + ( (flags&(1<<30)) ? 32 : 0 ); i_size = GetDWLE( &p_peek[8+4] ) + ( (flags&(1<<30)) ? 32 : 0 );
/* Skip the entire tag */ /* Skip the entire tag */
stream_Read( p_demux->s, NULL, i_size ); if( stream_Read( p_demux->s, NULL, i_size ) < i_size )
return false;
msg_Dbg( p_demux, "AP2 v%d tag found, skipping %d bytes", msg_Dbg( p_demux, "AP2 v%d tag found, skipping %d bytes",
i_version/1000, i_size ); i_version/1000, i_size );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment