Fix getframe saving empty file due to buf.bytesused always being 0

This commit is contained in:
Kristian Vos
2024-04-24 16:43:56 +02:00
committed by Martijn Braam
parent 0f9d6ea6c4
commit 0cb1061e1b

View File

@@ -269,7 +269,7 @@ main(int argc, char *argv[])
if (count == 0 && outfile != NULL) {
FILE *fp = fopen(outfile, "w");
fwrite(buffers[buf.index].start, buf.bytesused, 1, fp);
fwrite(buffers[buf.index].start, buffers[buf.index].length, 1, fp);
fclose(fp);
printf("Stored frame to: %s\n", outfile);
printf("Format: %dx%d\n", mode->width, mode->height);