forked from enlightenment/efl
Evas gl: Fix buffer dump filenames
evas_gl_common_buffer_dump can be used to dump all frames into a series of PNG files. But the filename contained some garbage characters (and potential segv, too). (cherry picked from commit a0f886138ed5a28d0d1596df3b805fca06d1ae31)
This commit is contained in:
parent
320a9f18c5
commit
1a9b58f083
|
@ -3246,7 +3246,11 @@ evas_gl_common_buffer_dump(Evas_Engine_GL_Context *gc, const char* dname, const
|
||||||
char fname[100];
|
char fname[100];
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
|
|
||||||
sprintf(fname, "./%s/win_%s-fc_%03d_%s.png", dname, buf_name, frame, suffix);
|
if (suffix)
|
||||||
|
snprintf(fname, sizeof(fname), "./%s/win_%s-fc_%03d_%s.png", dname, buf_name, frame, suffix);
|
||||||
|
else
|
||||||
|
snprintf(fname, sizeof(fname), "./%s/win_%s-fc_%03d.png", dname, buf_name, frame);
|
||||||
|
fname[sizeof(fname) - 1] = '\0';
|
||||||
|
|
||||||
data1 = (DATA32 *)malloc(gc->w * gc->h * sizeof(DATA32));
|
data1 = (DATA32 *)malloc(gc->w * gc->h * sizeof(DATA32));
|
||||||
data2 = (DATA32 *)malloc(gc->w * gc->h * sizeof(DATA32));
|
data2 = (DATA32 *)malloc(gc->w * gc->h * sizeof(DATA32));
|
||||||
|
|
|
@ -1576,7 +1576,6 @@ eng_output_flush(void *data, Evas_Render_Mode render_mode)
|
||||||
if (swap_buffer_debug)
|
if (swap_buffer_debug)
|
||||||
{
|
{
|
||||||
char fname[100];
|
char fname[100];
|
||||||
char suffix[100];
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
snprintf(fname, sizeof(fname), "%p", (void*)re->win);
|
snprintf(fname, sizeof(fname), "%p", (void*)re->win);
|
||||||
|
|
||||||
|
@ -1584,7 +1583,7 @@ eng_output_flush(void *data, Evas_Render_Mode render_mode)
|
||||||
(const char*)dname,
|
(const char*)dname,
|
||||||
(const char*)fname,
|
(const char*)fname,
|
||||||
re->frame_cnt,
|
re->frame_cnt,
|
||||||
suffix);
|
NULL);
|
||||||
if (!ret) swap_buffer_debug_mode = 0;
|
if (!ret) swap_buffer_debug_mode = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1231,7 +1231,6 @@ eng_output_flush(void *data, Evas_Render_Mode render_mode)
|
||||||
if (swap_buffer_debug)
|
if (swap_buffer_debug)
|
||||||
{
|
{
|
||||||
char fname[100];
|
char fname[100];
|
||||||
char suffix[100];
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
sprintf(fname, "%p", (void*)re->win);
|
sprintf(fname, "%p", (void*)re->win);
|
||||||
|
|
||||||
|
@ -1239,7 +1238,7 @@ eng_output_flush(void *data, Evas_Render_Mode render_mode)
|
||||||
(const char*)dname,
|
(const char*)dname,
|
||||||
(const char*)fname,
|
(const char*)fname,
|
||||||
re->frame_cnt,
|
re->frame_cnt,
|
||||||
suffix);
|
NULL);
|
||||||
if (!ret) swap_buffer_debug_mode = 0;
|
if (!ret) swap_buffer_debug_mode = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue