Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-19 Thread Michael Niedermayer
On Thu, Oct 19, 2017 at 09:01:36AM +0200, Jorge Ramirez wrote: > On 10/18/2017 09:40 PM, Michael Niedermayer wrote: > >On Wed, Oct 18, 2017 at 09:46:40AM +0200, Jorge Ramirez wrote: > >>On 10/18/2017 12:34 AM, Mark Thompson wrote: > int ff_v4l2_m2m_codec_end(AVCodecContext *avctx) > {

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-19 Thread Jorge Ramirez
On 10/18/2017 09:40 PM, Michael Niedermayer wrote: On Wed, Oct 18, 2017 at 09:46:40AM +0200, Jorge Ramirez wrote: On 10/18/2017 12:34 AM, Mark Thompson wrote: int ff_v4l2_m2m_codec_end(AVCodecContext *avctx) { -V4L2m2mContext* s = avctx->priv_data; -int ret; +V4L2m2mContext

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-18 Thread Michael Niedermayer
On Wed, Oct 18, 2017 at 09:46:40AM +0200, Jorge Ramirez wrote: > On 10/18/2017 12:34 AM, Mark Thompson wrote: > >> int ff_v4l2_m2m_codec_end(AVCodecContext *avctx) > >> { > >>-V4L2m2mContext* s = avctx->priv_data; > >>-int ret; > >>+V4L2m2mContext *m2m, *s = avctx->priv_data; > >>+

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-18 Thread Jorge Ramirez
On 10/18/2017 03:28 PM, Mark Thompson wrote: On 18/10/17 08:46, Jorge Ramirez wrote: On 10/18/2017 12:34 AM, Mark Thompson wrote: int ff_v4l2_m2m_codec_end(AVCodecContext *avctx) { -V4L2m2mContext* s = avctx->priv_data; -int ret; +V4L2m2mContext *m2m, *s = avctx->priv_data; +

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-18 Thread Mark Thompson
On 18/10/17 08:46, Jorge Ramirez wrote: > On 10/18/2017 12:34 AM, Mark Thompson wrote: >>> int ff_v4l2_m2m_codec_end(AVCodecContext *avctx) >>> { >>> -V4L2m2mContext* s = avctx->priv_data; >>> -int ret; >>> +V4L2m2mContext *m2m, *s = avctx->priv_data; >>> +int i, ret; >>> >>>

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-18 Thread Jorge Ramirez
On 10/18/2017 12:34 AM, Mark Thompson wrote: int ff_v4l2_m2m_codec_end(AVCodecContext *avctx) { -V4L2m2mContext* s = avctx->priv_data; -int ret; +V4L2m2mContext *m2m, *s = avctx->priv_data; +int i, ret; ret = ff_v4l2_context_set_status(>output, VIDIOC_STREAMOFF);

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-17 Thread Mark Thompson
On 17/10/17 18:20, Jorge Ramirez-Ortiz wrote: > A user can close the codec while keeping references to some of the > capture buffers. When the codec is closed, the structure that keeps > the contexts, state and the driver file descriptor is freed. > > Since access to some of the elements in that

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-17 Thread Jorge Ramirez
On 10/17/2017 08:25 PM, wm4 wrote: On Tue, 17 Oct 2017 19:20:50 +0200 Jorge Ramirez-Ortiz wrote: A user can close the codec while keeping references to some of the capture buffers. When the codec is closed, the structure that keeps the contexts, state and the

Re: [FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-17 Thread wm4
On Tue, 17 Oct 2017 19:20:50 +0200 Jorge Ramirez-Ortiz wrote: > A user can close the codec while keeping references to some of the > capture buffers. When the codec is closed, the structure that keeps > the contexts, state and the driver file descriptor is freed.

[FFmpeg-devel] [PATCH] avcodec/v4l2: fix access to priv_data after codec close.

2017-10-17 Thread Jorge Ramirez-Ortiz
A user can close the codec while keeping references to some of the capture buffers. When the codec is closed, the structure that keeps the contexts, state and the driver file descriptor is freed. Since access to some of the elements in that structure is required to properly release the memory