Chromium Code Reviews| Index: media/midi/midi_manager_usb.cc |
| diff --git a/media/midi/midi_manager_usb.cc b/media/midi/midi_manager_usb.cc |
| index fcefdf5a5222891d7bfd1e62a460df67afcdb011..42c1fe84d6b5544f1a202a0fcc3cb8963d836892 100644 |
| --- a/media/midi/midi_manager_usb.cc |
| +++ b/media/midi/midi_manager_usb.cc |
| @@ -43,7 +43,11 @@ void MidiManagerUsb::DispatchSendMidiData(MidiManagerClient* client, |
| uint32_t port_index, |
| const std::vector<uint8>& data, |
| double timestamp) { |
| - DCHECK_LT(port_index, output_streams_.size()); |
| + if (port_index >= output_streams_.size()) { |
|
Takashi Toyoshima
2015/02/09 06:34:41
Can you add TODO(toyoshim) here?
I think we should
yhirano
2015/02/09 08:41:12
Done.
|
| + // |port_index| is provided by a renderer so we can't believe that it is |
| + // in the valid range. |
| + return; |
| + } |
| output_streams_[port_index]->Send(data); |
| client->AccumulateMidiBytesSent(data.size()); |
| } |