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

Unified Diff: src/codec/SkRawCodec.cpp

Issue 1638323002: Filx complier issue [-Werror, -Wvla] (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkRawCodec.cpp
diff --git a/src/codec/SkRawCodec.cpp b/src/codec/SkRawCodec.cpp
index 05f18ac635918d448149fe112374ebd57636789c..d554c1934f93fac30b44e57440549dfe29a1b9f2 100644
--- a/src/codec/SkRawCodec.cpp
+++ b/src/codec/SkRawCodec.cpp
@@ -405,7 +405,9 @@ SkCodec::Result SkRawCodec::onGetPixels(const SkImageInfo& requestedInfo, void*
}
void* dstRow = dst;
- uint8_t srcRow[width * 3];
+
+ static const int kStackBytes = 640 * 1024; // Ought to be enough for anybody.
msarett 2016/01/27 14:51:05 Any reason to not put this on the heap?
yujieqin 2016/01/27 14:53:00 I do not have preference here. Just follow the cod
mtklein 2016/01/27 14:53:32 Sorry, that number was a bit of a joke. How long
yujieqin 2016/01/27 14:57:53 Normally I would think it should be around thousan
msarett 2016/01/27 15:02:14 Let's use this: SkAutoTMalloc<uint8_t> srcRow(widt
yujieqin 2016/01/27 15:16:23 Done.
+ SkAutoSTMalloc<kStackBytes, uint8_t> srcRow(width * 3);
dng_pixel_buffer buffer;
buffer.fData = &srcRow[0];
« 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