summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-Chen Hsu <chunchenhsu@google.com>2018-03-14 10:03:03 +0800
committerChun-Chen TK Hsu <chunchenhsu@google.com>2018-03-14 11:56:29 +0000
commit182b44ee37a0e3071c19f1a34300502fff70d860 (patch)
treee5de47bff0d5cac6088d423bbcf586686fe0f2ad
parent6e63552f5058564e32899a7973ec073a460ff55d (diff)
downloadgem5-182b44ee37a0e3071c19f1a34300502fff70d860.tar.xz
base: Fix loop range in pngwriter
The inner loop range limit should be width instead of height. Change-Id: I091c590713c945d4bd04ffcc974d4eb8aa23d1b2 Signed-off-by: Chun-Chen Hsu <chunchenhsu@google.com> Reviewed-on: https://gem5-review.googlesource.com/9081 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
-rw-r--r--src/base/pngwriter.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/base/pngwriter.cc b/src/base/pngwriter.cc
index 3251ac885..9faf23c24 100644
--- a/src/base/pngwriter.cc
+++ b/src/base/pngwriter.cc
@@ -160,7 +160,7 @@ PngWriter::write(std::ostream &png) const
// libpng requires an array of pointers to the frame buffer's rows.
std::vector<PixelType> rowPacked(width);
for (unsigned y=0; y < height; ++y) {
- for (unsigned x=0; x < height; ++x) {
+ for (unsigned x=0; x < width; ++x) {
rowPacked[x] = fb.pixel(x, y);
}