[Coverity 1666134] Untrusted divisor in mpeg/ts.c
The divisor could be controlled by an attacker, who could cause a division by zero.
In J2K_Parse: An unscrutinized value from an untrusted source used as a divisor (CWE-369)
1351 uint16_t i_den = GetWBE( &p_buf[8] );
4. tainted_return_value: Function U16_AT returns tainted data.[show details]
5. var_assign: Assigning: i_num = U16_AT(&p_buf[10]), which taints i_num.
1352 uint16_t i_num = GetWBE( &p_buf[10] );
6. Condition i_den == 0, taking false branch.
1353 if( i_den == 0 )
1354 goto invalid;
CID 1666134: (#1 of 1): Untrusted divisor (TAINTED_SCALAR)
7. tainted_data: Passing tainted expression i_num to vlc_tick_from_samples, which uses it as a divisor or modulus.[show details]
Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
1355 p_block->i_length = vlc_tick_from_samples( i_den, i_num );
Either the numerator/denominator are read/used in the wrong order. Or the test for 0 should be on i_num
.