Hitting ctrl-f5 within the latest SVN build posted at EmuCR (DOSBox SVN r3869) causes the program to go non-responsive, Necessitating a force close to return to the desktop.
I have tested it from the prompt as well as within 4 different games.
--- old/src/hardware/hardware.cpp 2017-05-30 13:35:08.000000000 +0200
+++ new/src/hardware/hardware.cpp 2017-06-18 17:07:23.236694300 +0200
@@ -361,7 +361,7 @@
}
#ifdef PNG_TEXT_SUPPORTED
int fields = 1;
- png_text text[1];
+ png_text text[1] = {};
const char* text_s = "DOSBox " VERSION;
size_t strl = strlen(text_s);
char* ptext_s = new char[strl + 1];
char key0[]="Title";
char text0[]="Mona Lisa";
text_ptr[0].key = key0;
text_ptr[0].text = text0;
text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE;
text_ptr[0].itxt_length = 0;
text_ptr[0].lang = NULL;
text_ptr[0].lang_key = NULL;
--- old/hardware.cpp 2017-06-19 11:09:59.000000000 +0200
+++ new/hardware.cpp 2017-06-29 23:41:19.855780300 +0200
@@ -298,6 +298,22 @@
}
#endif
+#if (C_SSHOT)
+void our_write(png_structp png_ptr, png_bytep data, png_size_t length) {
+ png_size_t check;
+
+ check = fwrite(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr));
+
+ if (check != length)
+ {
+ png_error(png_ptr, "Write Error");
+ }
+}
+
+void our_flush(png_structp png_ptr) {
+}
+#endif
+
void CAPTURE_AddImage(Bitu width, Bitu height, Bitu bpp, Bitu pitch, Bitu flags, float fps, Bit8u * data, Bit8u * pal) {
#if (C_SSHOT)
Bitu i;
@@ -333,7 +349,7 @@
}
/* Finalize the initing of png library */
- png_init_io(png_ptr, fp);
+ png_set_write_fn(png_ptr, (png_voidp)fp, our_write, our_flush);
png_set_compression_level(png_ptr,Z_BEST_COMPRESSION);
/* set other zlib parameters */
Mok wrote:It doesn't fix crash on Video capture, but it's a start
Users browsing this forum: No registered users and 3 guests