Explorar o código

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

Kristian Vos hai 1 ano
pai
achega
0cb1061e1b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      util/getframe.c

+ 1 - 1
util/getframe.c

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