libswscale/swscale.c:3196: error: Null Dereference
  pointer `filter` last assigned on line 3190 could be null and is dereferenced at line 3196, column 9.

libswscale/swscale.c:3185:1: start of procedure sws_getDefaultFilter()
3183. #endif
3184. 
3185. SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
      ^
3186.                                 float lumaSharpen, float chromaSharpen,
3187.                                 float chromaHShift, float chromaVShift,

libswscale/swscale.c:3190:5: 
3188.                                 int verbose)
3189. {
3190.     SwsFilter *filter= av_malloc(sizeof(SwsFilter));
          ^
3191. 
3192.     if (lumaGBlur!=0.0) {

libavutil/mem.c:47:1: start of procedure av_malloc()
  45.    linker will do it automatically. */
  46. 
  47. void *av_malloc(unsigned int size)
      ^
  48. {
  49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
  47. void *av_malloc(unsigned int size)
  48. {
  49.     void *ptr = NULL;
          ^
  50. #if CONFIG_MEMALIGN_HACK
  51.     long diff;

libavutil/mem.c:55:8: Taking false branch
  53. 
  54.     /* let's disallow possible ambiguous cases */
  55.     if(size > (INT_MAX-16) )
             ^
  56.         return NULL;
  57. 

libavutil/mem.c:66:9: Taking true branch
  64.     ((char*)ptr)[-1]= diff;
  65. #elif HAVE_POSIX_MEMALIGN
  66.     if (posix_memalign(&ptr,16,size))
              ^
  67.         ptr = NULL;
  68. #elif HAVE_MEMALIGN

libavutil/mem.c:67:9: 
  65. #elif HAVE_POSIX_MEMALIGN
  66.     if (posix_memalign(&ptr,16,size))
  67.         ptr = NULL;
              ^
  68. #elif HAVE_MEMALIGN
  69.     ptr = memalign(16,size);

libavutil/mem.c:99:5: 
   97.     ptr = malloc(size);
   98. #endif
   99.     return ptr;
           ^
  100. }
  101. 

libavutil/mem.c:100:1: return from a call to av_malloc
   98. #endif
   99.     return ptr;
  100. }
       ^
  101. 
  102. void *av_realloc(void *ptr, unsigned int size)

libswscale/swscale.c:3192:9: Taking false branch
3190.     SwsFilter *filter= av_malloc(sizeof(SwsFilter));
3191. 
3192.     if (lumaGBlur!=0.0) {
              ^
3193.         filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);
3194.         filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);

libswscale/swscale.c:3196:9: 
3194.         filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);
3195.     } else {
3196.         filter->lumH= sws_getIdentityVec();
              ^
3197.         filter->lumV= sws_getIdentityVec();
3198.     }

libswscale/swscale.c:3290:1: start of procedure sws_getIdentityVec()
  3288. 
  3289. 
  3290. SwsVector *sws_getIdentityVec(void)
        ^
  3291. {
  3292.     return sws_getConstVec(1.0, 1);

libswscale/swscale.c:3292:5: 
  3290. SwsVector *sws_getIdentityVec(void)
  3291. {
  3292.     return sws_getConstVec(1.0, 1);
            ^
  3293. }
  3294. 

libswscale/swscale.c:3275:1: start of procedure sws_getConstVec()
    3273. }
    3274. 
    3275. SwsVector *sws_getConstVec(double c, int length)
          ^
    3276. {
    3277.     int i;

libswscale/swscale.c:3278:5: Skipping sws_allocVec(): empty list of specs
    3276. {
    3277.     int i;
    3278.     SwsVector *vec= sws_allocVec(length);
              ^
    3279. 
    3280.     if (!vec)

libswscale/swscale.c:3280:10: Taking true branch
    3278.     SwsVector *vec= sws_allocVec(length);
    3279. 
    3280.     if (!vec)
                   ^
    3281.         return NULL;
    3282. 

libswscale/swscale.c:3281:9: 
    3279. 
    3280.     if (!vec)
    3281.         return NULL;
                  ^
    3282. 
    3283.     for (i=0; i<length; i++)

libswscale/swscale.c:3287:1: return from a call to sws_getConstVec
    3285. 
    3286.     return vec;
    3287. }
          ^
    3288. 
    3289. 

libswscale/swscale.c:3293:1: return from a call to sws_getIdentityVec
  3291. {
  3292.     return sws_getConstVec(1.0, 1);
  3293. }
        ^
  3294. 
  3295. double sws_dcVec(SwsVector *a)

SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
                                float lumaSharpen, float chromaSharpen,
                                float chromaHShift, float chromaVShift,
                                int verbose)
{
    SwsFilter *filter= av_malloc(sizeof(SwsFilter));
    if (lumaGBlur!=0.0) {
        filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);
        filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);
    } else {
        filter->lumH= sws_getIdentityVec();
        filter->lumV= sws_getIdentityVec();
    }
    if (chromaGBlur!=0.0) {
        filter->chrH= sws_getGaussianVec(chromaGBlur, 3.0);
        filter->chrV= sws_getGaussianVec(chromaGBlur, 3.0);
    } else {
        filter->chrH= sws_getIdentityVec();
        filter->chrV= sws_getIdentityVec();
    }
    if (chromaSharpen!=0.0) {
        SwsVector *id= sws_getIdentityVec();
        sws_scaleVec(filter->chrH, -chromaSharpen);
        sws_scaleVec(filter->chrV, -chromaSharpen);
        sws_addVec(filter->chrH, id);
        sws_addVec(filter->chrV, id);
        sws_freeVec(id);
    }
    if (lumaSharpen!=0.0) {
        SwsVector *id= sws_getIdentityVec();
        sws_scaleVec(filter->lumH, -lumaSharpen);
        sws_scaleVec(filter->lumV, -lumaSharpen);
        sws_addVec(filter->lumH, id);
        sws_addVec(filter->lumV, id);
        sws_freeVec(id);
    }
    if (chromaHShift != 0.0)
        sws_shiftVec(filter->chrH, (int)(chromaHShift+0.5));
    if (chromaVShift != 0.0)
        sws_shiftVec(filter->chrV, (int)(chromaVShift+0.5));
    sws_normalizeVec(filter->chrH, 1.0);
    sws_normalizeVec(filter->chrV, 1.0);
    sws_normalizeVec(filter->lumH, 1.0);
    sws_normalizeVec(filter->lumV, 1.0);
    if (verbose) sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG);
    if (verbose) sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG);
    return filter;
}
['SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,\n                                float lumaSharpen, float chromaSharpen,\n                                float chromaHShift, float chromaVShift,\n                                int verbose)\n{\n    SwsFilter *filter= av_malloc(sizeof(SwsFilter));\n    if (lumaGBlur!=0.0) {\n        filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);\n        filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);\n    } else {\n        filter->lumH= sws_getIdentityVec();\n        filter->lumV= sws_getIdentityVec();\n    }\n    if (chromaGBlur!=0.0) {\n        filter->chrH= sws_getGaussianVec(chromaGBlur, 3.0);\n        filter->chrV= sws_getGaussianVec(chromaGBlur, 3.0);\n    } else {\n        filter->chrH= sws_getIdentityVec();\n        filter->chrV= sws_getIdentityVec();\n    }\n    if (chromaSharpen!=0.0) {\n        SwsVector *id= sws_getIdentityVec();\n        sws_scaleVec(filter->chrH, -chromaSharpen);\n        sws_scaleVec(filter->chrV, -chromaSharpen);\n        sws_addVec(filter->chrH, id);\n        sws_addVec(filter->chrV, id);\n        sws_freeVec(id);\n    }\n    if (lumaSharpen!=0.0) {\n        SwsVector *id= sws_getIdentityVec();\n        sws_scaleVec(filter->lumH, -lumaSharpen);\n        sws_scaleVec(filter->lumV, -lumaSharpen);\n        sws_addVec(filter->lumH, id);\n        sws_addVec(filter->lumV, id);\n        sws_freeVec(id);\n    }\n    if (chromaHShift != 0.0)\n        sws_shiftVec(filter->chrH, (int)(chromaHShift+0.5));\n    if (chromaVShift != 0.0)\n        sws_shiftVec(filter->chrV, (int)(chromaVShift+0.5));\n    sws_normalizeVec(filter->chrH, 1.0);\n    sws_normalizeVec(filter->chrV, 1.0);\n    sws_normalizeVec(filter->lumH, 1.0);\n    sws_normalizeVec(filter->lumV, 1.0);\n    if (verbose) sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG);\n    if (verbose) sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG);\n    return filter;\n}', 'void *av_malloc(unsigned int size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+16);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&15) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr,16,size))\n        ptr = NULL;\n#elif HAVE_MEMALIGN\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}', 'SwsVector *sws_getIdentityVec(void)\n{\n    return sws_getConstVec(1.0, 1);\n}', 'SwsVector *sws_getConstVec(double c, int length)\n{\n    int i;\n    SwsVector *vec= sws_allocVec(length);\n    if (!vec)\n        return NULL;\n    for (i=0; i<length; i++)\n        vec->coeff[i]= c;\n    return vec;\n}']