---
 libavfilter/af_amix.c       |  4 ++--
 libavfilter/af_channelmap.c |  4 ++--
 libavfilter/avfilter.c      |  4 ++--
 libavfilter/buffer.c        | 14 +++++++-------
 libavfilter/buffersink.c    |  2 +-
 libavfilter/fifo.c          |  2 +-
 libavfilter/formats.c       |  6 +++---
 libavfilter/graphparser.c   | 24 ++++++++++++------------
 libavfilter/vf_drawtext.c   |  2 +-
 libavfilter/vf_frei0r.c     |  2 +-
 libavfilter/vf_libopencv.c  |  6 +++---
 libavfilter/vf_unsharp.c    |  2 +-
 libavfilter/video.c         |  6 +++---
 13 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index bfba150..09dc9d1 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -80,7 +80,7 @@ static void frame_list_clear(FrameList *frame_list)
         while (frame_list->list) {
             FrameInfo *info = frame_list->list;
             frame_list->list = info->next;
-            av_free(info);
+            av_freep(&info);
         }
         frame_list->nb_frames  = 0;
         frame_list->nb_samples = 0;
@@ -118,7 +118,7 @@ static void frame_list_remove_samples(FrameList 
*frame_list, int nb_samples)
                     frame_list->end = NULL;
                 frame_list->nb_frames--;
                 frame_list->nb_samples -= info->nb_samples;
-                av_free(info);
+                av_freep(&info);
             } else {
                 info->nb_samples       -= samples;
                 info->pts              += samples;
diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index 3035405..73da9ee 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -324,11 +324,11 @@ static int channelmap_filter_frame(AVFilterLink *inlink, 
AVFrame *buf)
             if (buf->extended_data == buf->data) {
                 buf->extended_data = new_extended_data;
             } else {
-                av_free(buf->extended_data);
+                av_freep(&buf->extended_data);
                 buf->extended_data = new_extended_data;
             }
         } else if (buf->extended_data != buf->data) {
-            av_free(buf->extended_data);
+            av_freep(&buf->extended_data);
             buf->extended_data = buf->data;
         }
     }
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 4098973..3463b69 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -462,7 +462,7 @@ err:
     ret->nb_outputs = 0;
     av_freep(&ret->priv);
     av_freep(&ret->internal);
-    av_free(ret);
+    av_freep(&ret);
     return NULL;
 }
 
@@ -520,7 +520,7 @@ void avfilter_free(AVFilterContext *filter)
     av_freep(&filter->outputs);
     av_freep(&filter->priv);
     av_freep(&filter->internal);
-    av_free(filter);
+    av_freep(&filter);
 }
 
 /* process a list of value1:value2:..., each value corresponding
diff --git a/libavfilter/buffer.c b/libavfilter/buffer.c
index fd0b18f..993b9af 100644
--- a/libavfilter/buffer.c
+++ b/libavfilter/buffer.c
@@ -31,8 +31,8 @@ void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
 {
     if (ptr->extended_data != ptr->data)
         av_freep(&ptr->extended_data);
-    av_free(ptr->data[0]);
-    av_free(ptr);
+    av_freep(&ptr->data[0]);
+    av_freep(&ptr);
 }
 
 AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
@@ -44,7 +44,7 @@ AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef 
*ref, int pmask)
     if (ref->type == AVMEDIA_TYPE_VIDEO) {
         ret->video = av_malloc(sizeof(AVFilterBufferRefVideoProps));
         if (!ret->video) {
-            av_free(ret);
+            av_freep(&ret);
             return NULL;
         }
         *ret->video = *ref->video;
@@ -52,7 +52,7 @@ AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef 
*ref, int pmask)
     } else if (ref->type == AVMEDIA_TYPE_AUDIO) {
         ret->audio = av_malloc(sizeof(AVFilterBufferRefAudioProps));
         if (!ret->audio) {
-            av_free(ret);
+            av_freep(&ret);
             return NULL;
         }
         *ret->audio = *ref->audio;
@@ -83,9 +83,9 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref)
         ref->buf->free(ref->buf);
     if (ref->extended_data != ref->data)
         av_freep(&ref->extended_data);
-    av_free(ref->video);
-    av_free(ref->audio);
-    av_free(ref);
+    av_freep(&ref->video);
+    av_freep(&ref->audio);
+    av_freep(&ref);
 }
 
 void avfilter_unref_bufferp(AVFilterBufferRef **ref)
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index 2894a5b..f673f8e 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -143,7 +143,7 @@ static void compat_free_buffer(AVFilterBuffer *buf)
 {
     AVFrame *frame = buf->priv;
     av_frame_free(&frame);
-    av_free(buf);
+    av_freep(&buf);
 }
 
 static int compat_read(AVFilterContext *ctx,
diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c
index a414585..b207b12 100644
--- a/libavfilter/fifo.c
+++ b/libavfilter/fifo.c
@@ -67,7 +67,7 @@ static av_cold void uninit(AVFilterContext *ctx)
     for (buf = fifo->root.next; buf; buf = tmp) {
         tmp = buf->next;
         av_frame_free(&buf->frame);
-        av_free(buf);
+        av_freep(&buf);
     }
 
     av_frame_free(&fifo->out);
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index ea61ed2..aa6e23b 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -294,9 +294,9 @@ do {                                                        
       \
             sizeof(*(*ref)->refs) * ((*ref)->refcount - idx - 1)); \
                                                                    \
     if(!--(*ref)->refcount) {                                      \
-        av_free((*ref)->list);                                     \
-        av_free((*ref)->refs);                                     \
-        av_free(*ref);                                             \
+        av_freep(&(*ref)->list);                                   \
+        av_freep(&(*ref)->refs);                                   \
+        av_freep(ref);                                             \
     }                                                              \
     *ref = NULL;                                                   \
 } while (0)
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index e20dd62..d16cd5e 100644
--- a/libavfilter/graphparser.c
+++ b/libavfilter/graphparser.c
@@ -166,8 +166,8 @@ static int parse_filter(AVFilterContext **filt_ctx, const 
char **buf, AVFilterGr
     }
 
     ret = create_filter(filt_ctx, graph, index, name, opts, log_ctx);
-    av_free(name);
-    av_free(opts);
+    av_freep(&name);
+    av_freep(&opts);
     return ret;
 }
 
@@ -238,8 +238,8 @@ static int link_filter_inouts(AVFilterContext *filt_ctx,
 
         if (p->filter_ctx) {
             ret = link_filter(p->filter_ctx, p->pad_idx, filt_ctx, pad, 
log_ctx);
-            av_free(p->name);
-            av_free(p);
+            av_freep(&p->name);
+            av_freep(&p);
             if (ret < 0)
                 return ret;
         } else {
@@ -286,11 +286,11 @@ static int parse_inputs(const char **buf, AVFilterInOut 
**curr_inputs,
         match = extract_inout(name, open_outputs);
 
         if (match) {
-            av_free(name);
+            av_freep(&name);
         } else {
             /* Not in the list, so add it as an input */
             if (!(match = av_mallocz(sizeof(AVFilterInOut)))) {
-                av_free(name);
+                av_freep(&name);
                 return AVERROR(ENOMEM);
             }
             match->name    = name;
@@ -327,7 +327,7 @@ static int parse_outputs(const char **buf, AVFilterInOut 
**curr_inputs,
         if (!input) {
             av_log(log_ctx, AV_LOG_ERROR,
                    "No output pad can be associated to link label '%s'.\n", 
name);
-            av_free(name);
+            av_freep(&name);
             return AVERROR(EINVAL);
         }
         *curr_inputs = (*curr_inputs)->next;
@@ -338,13 +338,13 @@ static int parse_outputs(const char **buf, AVFilterInOut 
**curr_inputs,
         if (match) {
             if ((ret = link_filter(input->filter_ctx, input->pad_idx,
                                    match->filter_ctx, match->pad_idx, 
log_ctx)) < 0) {
-                av_free(name);
+                av_freep(&name);
                 return ret;
             }
-            av_free(match->name);
-            av_free(name);
-            av_free(match);
-            av_free(input);
+            av_freep(&match->name);
+            av_freep(&name);
+            av_freep(&match);
+            av_freep(&input);
         } else {
             /* Not in the list, so add the first input as a open_output */
             input->name = name;
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 0befb56..5c0a56d 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -488,7 +488,7 @@ static int query_formats(AVFilterContext *ctx)
 
 static int glyph_enu_free(void *opaque, void *elem)
 {
-    av_free(elem);
+    av_freep(&elem);
     return 0;
 }
 
diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index 0122b8d..29b5135 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -152,7 +152,7 @@ static int set_params(AVFilterContext *ctx, const char 
*params)
             if (*params)
                 params++;               /* skip ':' */
             ret = set_param(ctx, info, i, param);
-            av_free(param);
+            av_freep(&param);
             if (ret < 0)
                 return ret;
         }
diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c
index 31fad1f..1540d8d 100644
--- a/libavfilter/vf_libopencv.c
+++ b/libavfilter/vf_libopencv.c
@@ -194,7 +194,7 @@ static int read_shape_from_file(int *cols, int *rows, int 
**values, const char *
             line[j] = 0;
             av_log(log_ctx, AV_LOG_DEBUG, "%3d: %s\n", i, line);
         }
-        av_free(line);
+        av_freep(&line);
     }
 #endif
 
@@ -273,7 +273,7 @@ static av_cold int dilate_init(AVFilterContext *ctx, const 
char *args)
                                    *kernel_str ? kernel_str : 
default_kernel_str,
                                    ctx)) < 0)
         return ret;
-    av_free(kernel_str);
+    av_freep(&kernel_str);
 
     sscanf(buf, "|%d", &dilate->nb_iterations);
     av_log(ctx, AV_LOG_VERBOSE, "iterations_nb:%d\n", dilate->nb_iterations);
@@ -349,7 +349,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 
     if (s->uninit)
         s->uninit(ctx);
-    av_free(s->priv);
+    av_freep(&s->priv);
 }
 
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c
index d0d59e2..e9a4ec1 100644
--- a/libavfilter/vf_unsharp.c
+++ b/libavfilter/vf_unsharp.c
@@ -192,7 +192,7 @@ static void free_filter_param(FilterParam *fp)
     int z;
 
     for (z = 0; z < 2 * fp->steps_y; z++)
-        av_free(fp->sc[z]);
+        av_freep(&fp->sc[z]);
 }
 
 static av_cold void uninit(AVFilterContext *ctx)
diff --git a/libavfilter/video.c b/libavfilter/video.c
index 9f1103e..7eebebc 100644
--- a/libavfilter/video.c
+++ b/libavfilter/video.c
@@ -94,9 +94,9 @@ avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], 
int linesize[4], int
 
 fail:
     if (picref && picref->video)
-        av_free(picref->video);
-    av_free(picref);
-    av_free(pic);
+        av_freep(&picref->video);
+    av_freep(&picref);
+    av_freep(&pic);
     return NULL;
 }
 #endif
-- 
1.9.3 (Apple Git-50)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to