Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: webrtc/modules/desktop_capture/desktop_frame.cc

Issue 2987363002: Irrational check in the constructor of DesktopFrame: stride_ may be negative (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 21 matching lines...) Expand all
32 DesktopFrame::DesktopFrame(DesktopRect rect, 32 DesktopFrame::DesktopFrame(DesktopRect rect,
33 int stride, 33 int stride,
34 uint8_t* data, 34 uint8_t* data,
35 SharedMemory* shared_memory) 35 SharedMemory* shared_memory)
36 : data_(data), 36 : data_(data),
37 shared_memory_(shared_memory), 37 shared_memory_(shared_memory),
38 rect_(rect), 38 rect_(rect),
39 stride_(stride), 39 stride_(stride),
40 capture_time_ms_(0), 40 capture_time_ms_(0),
41 capturer_id_(DesktopCapturerId::kUnknown) { 41 capturer_id_(DesktopCapturerId::kUnknown) {
42 RTC_DCHECK(stride_ >= 0);
43 RTC_DCHECK(rect.width() >= 0); 42 RTC_DCHECK(rect.width() >= 0);
44 RTC_DCHECK(rect.height() >= 0); 43 RTC_DCHECK(rect.height() >= 0);
45 } 44 }
46 45
47 DesktopFrame::~DesktopFrame() = default; 46 DesktopFrame::~DesktopFrame() = default;
48 47
49 void DesktopFrame::CopyPixelsFrom(const uint8_t* src_buffer, int src_stride, 48 void DesktopFrame::CopyPixelsFrom(const uint8_t* src_buffer, int src_stride,
50 const DesktopRect& dest_rect) { 49 const DesktopRect& dest_rect) {
51 RTC_CHECK(DesktopRect::MakeSize(size()).ContainsRect(dest_rect)); 50 RTC_CHECK(DesktopRect::MakeSize(size()).ContainsRect(dest_rect));
52 51
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 : DesktopFrame(rect, 142 : DesktopFrame(rect,
144 stride, 143 stride,
145 reinterpret_cast<uint8_t*>(shared_memory->data()), 144 reinterpret_cast<uint8_t*>(shared_memory->data()),
146 shared_memory) {} 145 shared_memory) {}
147 146
148 SharedMemoryDesktopFrame::~SharedMemoryDesktopFrame() { 147 SharedMemoryDesktopFrame::~SharedMemoryDesktopFrame() {
149 delete shared_memory_; 148 delete shared_memory_;
150 } 149 }
151 150
152 } // namespace webrtc 151 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698