[FFmpeg-cvslog] Remove a few if (p) av_freep(&p) forms

Clément Bœsch git
Sun Feb 6 21:08:53 CET 2011


ffmpeg | branch: master | Cl?ment B?sch <ubitux at gmail.com> | Thu Feb  3 11:30:17 2011 +0100| [b9004bd50c2fa5d4c0ef71ec09c9e70ec83f2e87] | committer: Michael Niedermayer

Remove a few if (p) av_freep(&p) forms

Signed-off-by: Mans Rullgard <mans at mansr.com>
(cherry picked from commit 523d9407d57e9210428b6d962f0ebf48aae55638)

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

 libavcodec/libxvidff.c    |    3 +--
 libavutil/tree.h          |    2 +-
 libswscale/swscale-test.c |    3 +--
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavcodec/libxvidff.c b/libavcodec/libxvidff.c
index 771fc2b..9008b84 100644
--- a/libavcodec/libxvidff.c
+++ b/libavcodec/libxvidff.c
@@ -527,8 +527,7 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) {
 
     xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);
 
-    if( avctx->extradata != NULL )
-        av_freep(&avctx->extradata);
+    av_freep(&avctx->extradata);
     if( x->twopassbuffer != NULL ) {
         av_free(x->twopassbuffer);
         av_free(x->old_twopassbuffer);
diff --git a/libavutil/tree.h b/libavutil/tree.h
index bf09fd0..8c7de2f 100644
--- a/libavutil/tree.h
+++ b/libavutil/tree.h
@@ -67,7 +67,7 @@ void *av_tree_find(const struct AVTreeNode *root, void *key, int (*cmp)(void *ke
  *                 return av_tree_insert(rootp, key, cmp, next);
  *             }
  *             void *tree_remove(struct AVTreeNode **rootp, void *key, int (*cmp)(void *key, const void *b, AVTreeNode **next)){
- *                 if(*next) av_freep(next);
+ *                 av_freep(next);
  *                 return av_tree_insert(rootp, key, cmp, next);
  *             }
  *             @endcode
diff --git a/libswscale/swscale-test.c b/libswscale/swscale-test.c
index ae5f8b7..bd24f3e 100644
--- a/libswscale/swscale-test.c
+++ b/libswscale/swscale-test.c
@@ -104,8 +104,7 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h,
         int p;
 
         for (p = 0; p < 4; p++)
-            if (src[p])
-                av_freep(&src[p]);
+            av_freep(&src[p]);
 
         av_image_fill_linesizes(srcStride, srcFormat, srcW);
         for (p = 0; p < 4; p++) {




More information about the ffmpeg-cvslog mailing list