Chromium Code Reviews| Index: media/capture/video/win/sink_input_pin_win.cc |
| diff --git a/media/capture/video/win/sink_input_pin_win.cc b/media/capture/video/win/sink_input_pin_win.cc |
| index 0abd0a785c10cc83c3969d8de5f29502ec72f01a..6ba69e5705269660871297208339fe7ac9f346f6 100644 |
| --- a/media/capture/video/win/sink_input_pin_win.cc |
| +++ b/media/capture/video/win/sink_input_pin_win.cc |
| @@ -193,8 +193,9 @@ HRESULT SinkInputPin::Receive(IMediaSample* sample) { |
| const int length = sample->GetActualDataLength(); |
| uint8_t* buffer = NULL; |
|
mcasas
2016/10/03 17:32:32
nit: move this to l. 202 and s/NULL/nullptr/
|
| - if (length <= 0) { |
| - DLOG(WARNING) << "Media sample length is 0 or less."; |
| + if (length <= 0 || |
| + static_cast<size_t>(length) < resulting_format_.ImageAllocationSize()) { |
| + DLOG(WARNING) << "Wrong media sample length: " << length; |
| return S_FALSE; |
| } |
| @@ -208,7 +209,7 @@ HRESULT SinkInputPin::Receive(IMediaSample* sample) { |
| timestamp = base::TimeDelta::FromMicroseconds(start_time / 10); |
| } |
| - observer_->FrameReceived(buffer, length, timestamp); |
| + observer_->FrameReceived(buffer, length, resulting_format_, timestamp); |
| return S_OK; |
| } |