From 731fc5b816fad91607728a2bfd1db6bb0317d511 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 9 Jul 2015 16:13:40 -0400 Subject: stream_file: initialize `fd` Use the fd variable and delay assignment to priv->fd to mirror other branches of the if/else tree. --- stream/stream_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stream/stream_file.c b/stream/stream_file.c index bfc50df5de..54a848e4c8 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -249,11 +249,12 @@ static int open_f(stream_t *stream) if (strncmp(stream->url, "fd://", 5) == 0) { char *end = NULL; - priv->fd = strtol(stream->url + 5, &end, 0); + fd = strtol(stream->url + 5, &end, 0); if (!end || end == stream->url + 5 || end[0]) { MP_ERR(stream, "Invalid FD: %s\n", stream->url); return STREAM_ERROR; } + priv->fd = fd; priv->close = false; } else if (!strcmp(filename, "-")) { if (!write) { -- cgit v1.2.3