[FFmpeg-cvslog] lavfi/unsharp: add missing NULL check

Stefano Sabatini git at videolan.org
Sun Feb 17 11:53:17 CET 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Fri Feb 15 14:22:21 2013 +0100| [89505f2c3f8ee1b0b68fc220a226c8bf3cef24cd] | committer: Stefano Sabatini

lavfi/unsharp: add missing NULL check

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

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

diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c
index 32c864c..8c6e18a 100644
--- a/libavfilter/vf_unsharp.c
+++ b/libavfilter/vf_unsharp.c
@@ -216,7 +216,8 @@ static int init_filter_param(AVFilterContext *ctx, FilterParam *fp, const char *
            effect, effect_type, fp->msize_x, fp->msize_y, fp->amount / 65535.0);
 
     for (z = 0; z < 2 * fp->steps_y; z++)
-        fp->sc[z] = av_malloc(sizeof(*(fp->sc[z])) * (width + 2 * fp->steps_x));
+        if (!(fp->sc[z] = av_malloc(sizeof(*(fp->sc[z])) * (width + 2 * fp->steps_x))))
+            return AVERROR(ENOMEM);
 
     return 0;
 }



More information about the ffmpeg-cvslog mailing list