avfilter/drawutils: Fix format validity check in ff_draw_init()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Jun 2015 22:06:28 +0000 (00:06 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Jun 2015 22:06:28 +0000 (00:06 +0200)
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/drawutils.c

index 0b2f17e..3a1abbd 100644 (file)
@@ -160,7 +160,7 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
     unsigned i, nb_planes = 0;
     int pixelstep[MAX_PLANES] = { 0 };
 
-    if (!desc->name)
+    if (!desc || !desc->name)
         return AVERROR(EINVAL);
     if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL | AV_PIX_FMT_FLAG_ALPHA))
         return AVERROR(ENOSYS);