Skip to content

Commit 9365eb8

Browse files
committed
updated screen capture
1 parent 05469ed commit 9365eb8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

include/ScreenCapture.h

+4-6
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ namespace SL
105105

106106
inline void ExtractAndConvertToRGBA(const Image& img, unsigned char* dst, size_t dst_size)
107107
{
108-
auto totalsize = RowStride(img) * Height(img);
109-
assert(dst_size >= static_cast<size_t>(totalsize));
108+
109+
assert(dst_size >= static_cast<size_t>(RowStride(img) * Height(img)));
110110
auto imgsrc = StartSrc(img);
111111
auto imgdist = dst;
112112
for (auto h = 0; h < Height(img); h++) {
@@ -122,8 +122,7 @@ namespace SL
122122
}
123123
inline void ExtractAndConvertToRGB(const Image& img, unsigned char* dst, size_t dst_size)
124124
{
125-
auto totalsize = Width(img) * 3 * Height(img);
126-
assert(dst_size >= static_cast<size_t>(totalsize));
125+
assert(dst_size >= static_cast<size_t>(Width(img) * 3 * Height(img)));
127126
auto imgsrc = StartSrc(img);
128127
auto imgdist = dst;
129128
for (auto h = 0; h < Height(img); h++) {
@@ -139,8 +138,7 @@ namespace SL
139138

140139
inline void ExtractAndConvertToRGB565(const Image& img, unsigned char* dst, size_t dst_size)
141140
{
142-
auto totalsize = Width(img) * 2 * Height(img);
143-
assert(dst_size >= static_cast<size_t>(totalsize));
141+
assert(dst_size >= static_cast<size_t>(Width(img) * 2 * Height(img)));
144142
auto imgsrc = StartSrc(img);
145143
auto imgdist = dst;
146144
for (auto h = 0; h < Height(img); h++) {

0 commit comments

Comments
 (0)