[FFmpeg-devel] [PATCH 1/2] postproc: use av_freep() for saftey

Michael Niedermayer michaelni at gmx.at
Sat Aug 16 19:54:24 CEST 2014


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libpostproc/postprocess.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index 794cd30..397e4fb 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -931,17 +931,17 @@ void pp_free_context(void *vc){
     PPContext *c = (PPContext*)vc;
     int i;
 
-    for(i=0; i<3; i++) av_free(c->tempBlurred[i]);
-    for(i=0; i<3; i++) av_free(c->tempBlurredPast[i]);
-
-    av_free(c->tempBlocks);
-    av_free(c->yHistogram);
-    av_free(c->tempDst);
-    av_free(c->tempSrc);
-    av_free(c->deintTemp);
-    av_free(c->stdQPTable);
-    av_free(c->nonBQPTable);
-    av_free(c->forcedQPTable);
+    for(i=0; i<3; i++) av_freep(&c->tempBlurred[i]);
+    for(i=0; i<3; i++) av_freep(&c->tempBlurredPast[i]);
+
+    av_freep(&c->tempBlocks);
+    av_freep(&c->yHistogram);
+    av_freep(&c->tempDst);
+    av_freep(&c->tempSrc);
+    av_freep(&c->deintTemp);
+    av_freep(&c->stdQPTable);
+    av_freep(&c->nonBQPTable);
+    av_freep(&c->forcedQPTable);
 
     memset(c, 0, sizeof(PPContext));
 
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list