swscale: Assert that pixel format descriptor is not NULL
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Jun 2015 12:39:28 +0000 (14:39 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Jun 2015 12:47:37 +0000 (14:47 +0200)
This may help static analyzers, the pixel format is checked
during initialization

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/swscale.c
libswscale/utils.c

index 5312016..1945e1d 100644 (file)
@@ -784,6 +784,8 @@ static int check_image_pointers(const uint8_t * const data[4], enum AVPixelForma
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
     int i;
 
+    av_assert2(desc);
+
     for (i = 0; i < 4; i++) {
         int plane = desc->comp[i].plane;
         if (!data[plane] || !linesizes[plane])
index f9f4ec6..0c78d75 100644 (file)
@@ -1036,6 +1036,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
         return AVERROR(EINVAL);
     }
     }
+    av_assert2(desc_src && desc_dst);
 
     i = flags & (SWS_POINT         |
                  SWS_AREA          |