--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ --- a/modules/demux/mp4/mp4.c +++ b/modules/demux/mp4/mp4.c @@ -510,11 +510,11 @@ static block_t * MP4_EIA608_Convert( block_t * p_block ) block_t *p_newblock; /* always need at least 10 bytes (atom size+header+1pair)*/ - if ( i_remaining < 10 || - !(i_bytes = GetDWBE(p_block->p_buffer)) || - (i_bytes > i_remaining) || - memcmp("cdat", &p_block->p_buffer[4], 4) || - !(p_newblock = block_Alloc( i_remaining * 3 - 8 )) ) + i_bytes = GetDWBE(p_block->p_buffer); + + if (10 < i_bytes || i_bytes < i_remaining || + memcmp("cdat", &p_block->p_buffer[4], 4) || + (p_newblock = block_Alloc(i_remaining * 3 - 8)) == NULL) { p_block->i_buffer = 0; return p_block; @@ -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;