lavfi/hue: set to NULL freed pointers
authorStefano Sabatini <stefasab@gmail.com>
Fri, 21 Sep 2012 10:41:00 +0000 (12:41 +0200)
committerStefano Sabatini <stefasab@gmail.com>
Fri, 21 Sep 2012 10:44:44 +0000 (12:44 +0200)
Possibly safer.

libavfilter/vf_hue.c

index cfd71b1..e02a216 100644 (file)
@@ -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)