Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp |
| diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp |
| index ad5f360694195a5c931c610ddf901495308250ee..4e690a0f130376341ea23eb286690434692c8d2a 100644 |
| --- a/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp |
| +++ b/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp |
| @@ -150,8 +150,10 @@ private: |
| static const int channelMessageLength[7] = { 3, 3, 3, 3, 2, 2, 3 }; // for 0x8*, 0x9*, ..., 0xe* |
| static const int systemMessageLength[7] = { 2, 3, 2, 0, 0, 1, 0 }; // for 0xf1, 0xf2, ..., 0xf7 |
| size_t length = isSystemMessage() ? systemMessageLength[m_data[m_offset] - 0xf1] : channelMessageLength[(m_data[m_offset] >> 4) - 8]; |
|
yhirano
2016/05/10 16:08:24
DCHECK_GT(length, 0);
Takashi Toyoshima
2016/05/11 05:59:16
Good point.
I also added new test items that input
|
| - size_t count = 1; |
| - for (m_offset++; !isEndOfData(); m_offset++) { |
| + m_offset++; |
| + if (length == 1) |
| + return true; |
| + for (size_t count = 1; !isEndOfData(); m_offset++) { |
| if (isReservedStatusByte()) |
| return false; |
| if (isRealTimeMessage()) |