[FFmpeg-cvslog] lavfi/hue: set to NULL freed pointers

Stefano Sabatini git at videolan.org
Fri Sep 21 12:45:17 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Fri Sep 21 12:41:00 2012 +0200| [3aa1b532561e1b7ad066b85b2fd2d6fe44f0ed10] | committer: Stefano Sabatini

lavfi/hue: set to NULL freed pointers

Possibly safer.

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

 libavfilter/vf_hue.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_hue.c b/libavfilter/vf_hue.c
index cfd71b1..e02a216 100644
--- a/libavfilter/vf_hue.c
+++ b/libavfilter/vf_hue.c
@@ -118,8 +118,9 @@ static inline void compute_sin_and_cos(HueContext *hue)
             hue->attr##_pexpr = old_##attr##_pexpr;                               \
             return AVERROR(EINVAL);                                               \
         } else if (old_##attr##_pexpr) {                                          \
-            av_free(old_##attr##_expr);                                           \
+            av_freep(&old_##attr##_expr);                                         \
             av_expr_free(old_##attr##_pexpr);                                     \
+            old_##attr##_pexpr = NULL;                                            \
         }                                                                         \
     } while (0)
 



More information about the ffmpeg-cvslog mailing list