Browse Source

lavc/v4l2_m2m: don't close the file descriptor we don't own

ff_v4l2_m2m_create_context initialized V4L2m2mContext.fd to 0
which is a valid file descriptor value. Next ff_v4l2_m2m_codec_init
failed and v4l2_m2m_destroy_context closed file descriptor 0 even
though it didn't belong to V4L2m2mContext.

Signed-off-by: Pavel Koshevoy <pkoshevoy@gmail.com>
tags/n4.3
Pavel Koshevoy 6 years ago
parent
commit
6b57a294a3
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavcodec/v4l2_m2m.c

+ 1
- 0
libavcodec/v4l2_m2m.c View File

@@ -401,6 +401,7 @@ int ff_v4l2_m2m_create_context(AVCodecContext *avctx, V4L2m2mContext **s)
priv->context->capture.num_buffers = priv->num_capture_buffers;
priv->context->output.num_buffers = priv->num_output_buffers;
priv->context->self_ref = priv->context_ref;
priv->context->fd = -1;

return 0;
}

Loading…
Cancel
Save