[FFmpeg-cvslog] avcodec/v4l2_context: Use av_freep()

Andriy Gelman git at videolan.org
Thu Apr 9 04:49:05 EEST 2020


ffmpeg | branch: master | Andriy Gelman <andriy.gelman at gmail.com> | Sun Apr  5 01:36:13 2020 -0400| [cd04bb4afea111aa85afbaf806ae747103a843fd] | committer: Andriy Gelman

avcodec/v4l2_context: Use av_freep()

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd04bb4afea111aa85afbaf806ae747103a843fd
---

 libavcodec/v4l2_context.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
index 8110bbb555..31af10d28e 100644
--- a/libavcodec/v4l2_context.c
+++ b/libavcodec/v4l2_context.c
@@ -685,8 +685,7 @@ void ff_v4l2_context_release(V4L2Context* ctx)
     if (ret)
         av_log(logger(ctx), AV_LOG_WARNING, "V4L2 failed to unmap the %s buffers\n", ctx->name);
 
-    av_free(ctx->buffers);
-    ctx->buffers = NULL;
+    av_freep(&ctx->buffers);
 }
 
 int ff_v4l2_context_init(V4L2Context* ctx)
@@ -743,8 +742,7 @@ int ff_v4l2_context_init(V4L2Context* ctx)
 error:
     v4l2_release_buffers(ctx);
 
-    av_free(ctx->buffers);
-    ctx->buffers = NULL;
+    av_freep(&ctx->buffers);
 
     return ret;
 }



More information about the ffmpeg-cvslog mailing list