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>
This commit is contained in:
Chun-Chen Hsu
2018-03-14 10:03:03 +08:00
committed by Chun-Chen TK Hsu
parent 6e63552f50
commit 182b44ee37

View File

@@ -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);
}