[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/15] Fix vga_screen_dump_blank() PPM generation
From: |
Glauber Costa |
Subject: |
[Qemu-devel] [PATCH 15/15] Fix vga_screen_dump_blank() PPM generation |
Date: |
Wed, 17 Jun 2009 13:10:04 -0400 |
From: Eduardo Habkost <address@hidden>
vga_screen_dump_blank() was not generating a valid PPM file: the width of the
image made no sense (why it was multiplied by sizeof(uint32_t)?), and there was
only one sample per pixel, instead of three.
Signed-off-by: Eduardo Habkost <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>
Signed-off-by: Glauber Costa <address@hidden>
---
hw/vga.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/vga.c b/hw/vga.c
index 709d6bb..00a7ae5 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2606,8 +2606,9 @@ static void vga_screen_dump_blank(VGAState *s, const char
*filename)
{
FILE *f;
unsigned int y, x, w, h;
+ unsigned char blank_sample[3] = { 0, 0, 0 };
- w = s->last_scr_width * sizeof(uint32_t);
+ w = s->last_scr_width;
h = s->last_scr_height;
f = fopen(filename, "wb");
@@ -2616,7 +2617,7 @@ static void vga_screen_dump_blank(VGAState *s, const char
*filename)
fprintf(f, "P6\n%d %d\n%d\n", w, h, 255);
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
- fputc(0, f);
+ fwrite(blank_sample, 3, 1, f);
}
}
fclose(f);
--
1.6.2.2
- [Qemu-devel] [PATCH 05/15] e1000: Ignore reset command, (continued)
- [Qemu-devel] [PATCH 05/15] e1000: Ignore reset command, Glauber Costa, 2009/06/17
- [Qemu-devel] [PATCH 06/15] VNC: Fix memory allocation (wrong structure size)., Glauber Costa, 2009/06/17
- [Qemu-devel] [PATCH 07/15] fix raw_pread_aligned return value, Glauber Costa, 2009/06/17
- [Qemu-devel] [PATCH 08/15] BACKPORT: Register reset functions for e1000 and rtl8139, Glauber Costa, 2009/06/17
- [Qemu-devel] [PATCH 09/15] BACKPORT: Update irqs on reset and device load, Glauber Costa, 2009/06/17
- [Qemu-devel] [PATCH 10/15] BACKPORT: Add rtc reset function., Glauber Costa, 2009/06/17
- [Qemu-devel] [PATCH 11/15] fix qemu_aio_flush, Glauber Costa, 2009/06/17
- [Qemu-devel] [PATCH 12/15] QEMU KVM: i386: Fix the cpu reset state, Glauber Costa, 2009/06/17
- [Qemu-devel] [PATCH 13/15] kvm: Fix IRQ injection into full queue, Glauber Costa, 2009/06/17
- [Qemu-devel] [PATCH 14/15] Prevent CD-ROM media eject while device is locked, Glauber Costa, 2009/06/17
- [Qemu-devel] [PATCH 15/15] Fix vga_screen_dump_blank() PPM generation,
Glauber Costa <=
- [Qemu-devel] Re: [PATCH 09/15] BACKPORT: Update irqs on reset and device load, Blue Swirl, 2009/06/17
- [Qemu-devel] Re: [PATCH 09/15] BACKPORT: Update irqs on reset and device load, Glauber Costa, 2009/06/17
Re: [Qemu-devel] [GIT PULL 00/15] Stable branch update 2009-06-17, Anthony Liguori, 2009/06/17