Skip to content

Commit 19aaeeb

Browse files
committed
fixed a crash of vidcaps with own FPS indicator
1 parent 06f74f7 commit 19aaeeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ static void *capture_thread(void *arg)
458458
struct wait_obj *wait_obj = wait_obj_init();
459459
steady_clock::time_point t0 = steady_clock::now();
460460
int frames = 0;
461-
char *print_fps_prefix = strdupa(vidcap_get_fps_print_prefix(uv->capture_device));
461+
char *print_fps_prefix = vidcap_get_fps_print_prefix(uv->capture_device) ? strdupa(vidcap_get_fps_print_prefix(uv->capture_device)) : NULL;
462462
if (print_fps_prefix && print_fps_prefix[strlen(print_fps_prefix) - 1] == ' ') { // trim trailing ' '
463463
print_fps_prefix[strlen(print_fps_prefix) - 1] = '\0';
464464
}

0 commit comments

Comments
 (0)