Message ID | 20190902070100.12997-1-pkoshevoy@gmail.com |
---|---|
State | Accepted |
Commit | 6b57a294a32874c9cdc1de0310cbf1d693b4776f |
Headers | show |
Pavel Koshevoy (12019-09-02): > 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. > --- > libavcodec/v4l2_m2m.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c > index 427e165f58..ac583c811f 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; > } This change looks ok to me, but I do not maintain that file. Regards,
On Mon, Sep 2, 2019 at 12:27 AM Pavel Koshevoy <pkoshevoy@gmail.com> wrote: > 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. > --- > libavcodec/v4l2_m2m.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c > index 427e165f58..ac583c811f 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; LGTM. I ran into the same problem last week and have a similar change in my tree. > > return 0; > } > -- > 2.16.4 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
On Mon, Sep 2, 2019 at 10:40 AM Aman Gupta <ffmpeg@tmm1.net> wrote: > > > > On Mon, Sep 2, 2019 at 12:27 AM Pavel Koshevoy <pkoshevoy@gmail.com> wrote: >> >> 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. >> --- >> libavcodec/v4l2_m2m.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c >> index 427e165f58..ac583c811f 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; > > > > LGTM. I ran into the same problem last week and have a similar change in my tree. Thanks, patch applied, pushed. Pavel.
diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c index 427e165f58..ac583c811f 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; }