Skip to content

Commit bdbe824

Browse files
committed
qemu-edid: use qemu_edid_size()
So we only write out that part of the edid blob which has been filled with data. Also use a larger buffer for the blob. Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Marc-André Lureau <[email protected]> Message-id: [email protected] Message-Id: <[email protected]>
1 parent d90f154 commit bdbe824

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

qemu-edid.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ static void usage(FILE *out)
4141
int main(int argc, char *argv[])
4242
{
4343
FILE *outfile = NULL;
44-
uint8_t blob[256];
44+
uint8_t blob[512];
45+
size_t size;
4546
uint32_t dpi = 100;
4647
int rc;
4748

@@ -119,7 +120,8 @@ int main(int argc, char *argv[])
119120

120121
memset(blob, 0, sizeof(blob));
121122
qemu_edid_generate(blob, sizeof(blob), &info);
122-
fwrite(blob, sizeof(blob), 1, outfile);
123+
size = qemu_edid_size(blob);
124+
fwrite(blob, size, 1, outfile);
123125
fflush(outfile);
124126

125127
exit(0);

0 commit comments

Comments
 (0)