summaryrefslogtreecommitdiffstats
path: root/libavcodec/v4l2_m2m.c
diff options
context:
space:
mode:
authorPavel Koshevoy <pkoshevoy@gmail.com>2019-09-02 00:34:35 -0600
committerPavel Koshevoy <pkoshevoy@gmail.com>2019-09-02 11:28:43 -0600
commit6b57a294a32874c9cdc1de0310cbf1d693b4776f (patch)
tree95fc85f95377c5a3a8826f4ef5823445f837c7aa /libavcodec/v4l2_m2m.c
parent7ea2710ec4d1b8920017c05fbb23c346e807e0f2 (diff)
downloadffmpeg-streaming-6b57a294a32874c9cdc1de0310cbf1d693b4776f.zip
ffmpeg-streaming-6b57a294a32874c9cdc1de0310cbf1d693b4776f.tar.gz
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>
Diffstat (limited to 'libavcodec/v4l2_m2m.c')
-rw-r--r--libavcodec/v4l2_m2m.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c
index 427e165..ac583c8 100644
--- a/libavcodec/v4l2_m2m.c
+++ b/libavcodec/v4l2_m2m.c
@@ -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;
}
OpenPOWER on IntegriCloud