diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c index c91661c556..08a41c304b 100644 --- a/libavdevice/gdigrab.c +++ b/libavdevice/gdigrab.c @@ -281,7 +281,7 @@ gdigrab_read_header(AVFormatContext *s1) hwnd = (HWND) strtoull(name, &p, 0); - if (p == NULL || p == name || p[0] == '\0') + if (p == NULL || p == name || p[0] != '\0') { av_log(s1, AV_LOG_ERROR, "Invalid window handle '%s', must be a valid integer.\n", name);