# HG changeset patch # User bcoudurier # Date 1166005118 0 # Node ID ba2244f38a76e1a449f536c9cc53969a00840961 # Parent d63bac8be31a3ec4490a8900fe39763cf98e6f51 dont segv is ap->device is not set, display error message diff -r d63bac8be31a -r ba2244f38a76 x11grab.c --- a/x11grab.c Wed Dec 13 10:08:27 2006 +0000 +++ b/x11grab.c Wed Dec 13 10:18:38 2006 +0000 @@ -101,6 +101,11 @@ return AVERROR_IO; } + if (!ap->device) { + av_log(s1, AV_LOG_ERROR, "AVParameters don't specify any device. Use -vd.\n"); + return AVERROR_IO; + } + sscanf(ap->device, "x11:%d,%d", &x_off, &y_off); av_log(s1, AV_LOG_INFO, "device: %s -> x: %d y: %d width: %d height: %d\n", ap->device, x_off, y_off, ap->width, ap->height);