Rémi Bernon (@rbernon) commented about dlls/dmime/midi.c:
- if (hr != S_OK) return hr;
- if (read == 0) return S_FALSE;
- if (byte & 0x80)
- {
status = byte;
*last_status = byte;
- }
- else
- {
/* MIDI running status, the byte we just read is not the
* status byte, so move back 1 byte. */
status = *last_status;
offset.QuadPart = -1;
hr = IStream_Seek(stream, offset, STREAM_SEEK_CUR, NULL);
if (FAILED(hr)) return hr;
I don't think backtracking is a good pattern, especially if you consider that you don't know what the stream will have to do for that.
You're going to read or skip that byte in every case anyway, can we just keep it?