[vlc-commits] caf: fix error handling / integer overflow
Rémi Denis-Courmont
git at videolan.org
Wed Oct 21 18:45:24 CEST 2015
vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Aug 21 20:01:47 2015 +0300| [c6d45ea9e570f20c3aa16d72cf2423b463063124] | committer: Jean-Baptiste Kempf
caf: fix error handling / integer overflow
(cherry picked from commit de1b8bc4993780e2b92ee4b1e4ff27c9f3831dc6)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=c6d45ea9e570f20c3aa16d72cf2423b463063124
---
modules/demux/caf.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/demux/caf.c b/modules/demux/caf.c
index 465caf6..f5c63fc 100644
--- a/modules/demux/caf.c
+++ b/modules/demux/caf.c
@@ -277,7 +277,11 @@ static int FrameSpanAddDescription( demux_t *p_demux, uint64_t i_desc_offset, fr
}
const uint8_t *p_peek;
- uint32_t i_peek_len = stream_Peek( p_demux->s, &p_peek, 2 * 10 ); /* Peeking the maximum number of bytes that two 64 bit numbers could use (( 64 + 6 ) / 7 = 10 ). */
+ int i_peek_len = stream_Peek( p_demux->s, &p_peek, 2 * 10 );
+ /* Peeking the maximum number of bytes that two 64 bit numbers could use
+ * (( 64 + 6 ) / 7 = 10). */
+ if( i_peek_len < 0 )
+ i_peek_len = 0;
if( p_sys->fmt.audio.i_bytes_per_frame )
{
@@ -302,7 +306,7 @@ static int FrameSpanAddDescription( demux_t *p_demux, uint64_t i_desc_offset, fr
}
else
{
- if( i_desc_size >= i_peek_len )
+ if( i_desc_size >= (unsigned)i_peek_len )
{
return VLC_EGENERIC;
}
More information about the vlc-commits
mailing list