diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c index a40be94690..f20f713e1d 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -325,9 +325,13 @@ start: /* 0. handle errors */ if (pfd.revents & POLLERR) { - /* if we are trying to get free buffers but none have been queued yet - no need to raise a warning */ + /* if we are trying to get free buffers but none have been queued yet, + * or if no buffers have been allocated yet, no need to raise a warning + */ if (timeout == 0) { + if (!ctx->buffers) + return NULL; + for (i = 0; i < ctx->num_buffers; i++) { if (ctx->buffers[i].status != V4L2BUF_AVAILABLE) av_log(logger(ctx), AV_LOG_WARNING, "%s POLLERR\n", ctx->name);