From: Rémi Denis-Courmont Date: Thu, 27 Jun 2019 20:19:38 +0000 (+0300) Subject: mp4: fix integer underflow X-Git-Url: https://git.videolan.org/?p=vlc.git;a=commitdiff_plain;h=8e8e0d72447f8378244f5b4a3dcde036dbeb1491 mp4: fix integer underflow Reported-by: Hyeon-Ju Lee --- diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c index 77b46de1c3..83f36db1a7 100644 --- a/modules/demux/mp4/mp4.c +++ b/modules/demux/mp4/mp4.c @@ -536,10 +536,10 @@ static block_t * MP4_EIA608_Convert( block_t * p_block ) } while( i_bytes >= 2 ); /* cdt2 is optional */ - if ( i_remaining >= 10 && - (i_bytes = GetDWBE(p_read)) && - (i_bytes <= i_remaining) && - !memcmp("cdt2", &p_read[4], 4) ) + i_bytes = GetDWBE(p_read); + + if (10 <= i_bytes && i_bytes <= i_remaining && + !memcmp("cdt2", &p_read[4], 4)) { p_read += 8; i_bytes -= 8;