libswscale/swscale.c:3193: error: Null Dereference
  pointer `filter` last assigned on line 3190 could be null and is dereferenced at line 3193, 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 true 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:3193:9: 
3191. 
3192.     if (lumaGBlur!=0.0) {
3193.         filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);
              ^
3194.         filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);
3195.     } else {

libswscale/swscale.c:3255:1: start of procedure sws_getGaussianVec()
  3253. }
  3254. 
  3255. SwsVector *sws_getGaussianVec(double variance, double quality)
        ^
  3256. {
  3257.     const int length= (int)(variance*quality + 0.5) | 1;

libswscale/swscale.c:3257:5: 
  3255. SwsVector *sws_getGaussianVec(double variance, double quality)
  3256. {
  3257.     const int length= (int)(variance*quality + 0.5) | 1;
            ^
  3258.     int i;
  3259.     double middle= (length-1)*0.5;

libswscale/swscale.c:3259:5: 
  3257.     const int length= (int)(variance*quality + 0.5) | 1;
  3258.     int i;
  3259.     double middle= (length-1)*0.5;
            ^
  3260.     SwsVector *vec= sws_allocVec(length);
  3261. 

libswscale/swscale.c:3260:5: Skipping sws_allocVec(): empty list of specs
  3258.     int i;
  3259.     double middle= (length-1)*0.5;
  3260.     SwsVector *vec= sws_allocVec(length);
            ^
  3261. 
  3262.     if (!vec)

libswscale/swscale.c:3262:10: Taking false branch
  3260.     SwsVector *vec= sws_allocVec(length);
  3261. 
  3262.     if (!vec)
                 ^
  3263.         return NULL;
  3264. 

libswscale/swscale.c:3265:10: 
  3263.         return NULL;
  3264. 
  3265.     for (i=0; i<length; i++) {
                 ^
  3266.         double dist= i-middle;
  3267.         vec->coeff[i]= exp(-dist*dist/(2*variance*variance)) / sqrt(2*variance*PI);

libswscale/swscale.c:3265:15: Loop condition is false. Leaving loop
  3263.         return NULL;
  3264. 
  3265.     for (i=0; i<length; i++) {
                      ^
  3266.         double dist= i-middle;
  3267.         vec->coeff[i]= exp(-dist*dist/(2*variance*variance)) / sqrt(2*variance*PI);

libswscale/swscale.c:3270:5: 
  3268.     }
  3269. 
  3270.     sws_normalizeVec(vec, 1.0);
            ^
  3271. 
  3272.     return vec;

libswscale/swscale.c:3314:1: start of procedure sws_normalizeVec()
    3312. }
    3313. 
    3314. void sws_normalizeVec(SwsVector *a, double height)
          ^
    3315. {
    3316.     sws_scaleVec(a, height/sws_dcVec(a));

libswscale/swscale.c:3316:5: 
    3314. void sws_normalizeVec(SwsVector *a, double height)
    3315. {
    3316.     sws_scaleVec(a, height/sws_dcVec(a));
              ^
    3317. }
    3318. 

libswscale/swscale.c:3295:1: start of procedure sws_dcVec()
      3293. }
      3294. 
      3295. double sws_dcVec(SwsVector *a)
            ^
      3296. {
      3297.     int i;

libswscale/swscale.c:3298:5: 
      3296. {
      3297.     int i;
      3298.     double sum=0;
                ^
      3299. 
      3300.     for (i=0; i<a->length; i++)

libswscale/swscale.c:3300:10: 
      3298.     double sum=0;
      3299. 
      3300.     for (i=0; i<a->length; i++)
                     ^
      3301.         sum+= a->coeff[i];
      3302. 

libswscale/swscale.c:3300:15: Loop condition is false. Leaving loop
      3298.     double sum=0;
      3299. 
      3300.     for (i=0; i<a->length; i++)
                          ^
      3301.         sum+= a->coeff[i];
      3302. 

libswscale/swscale.c:3303:5: 
      3301.         sum+= a->coeff[i];
      3302. 
      3303.     return sum;
                ^
      3304. }
      3305. 

libswscale/swscale.c:3304:1: return from a call to sws_dcVec
      3302. 
      3303.     return sum;
      3304. }
            ^
      3305. 
      3306. void sws_scaleVec(SwsVector *a, double scalar)

libswscale/swscale.c:3306:1: start of procedure sws_scaleVec()
      3304. }
      3305. 
      3306. void sws_scaleVec(SwsVector *a, double scalar)
            ^
      3307. {
      3308.     int i;

libswscale/swscale.c:3310:10: 
      3308.     int i;
      3309. 
      3310.     for (i=0; i<a->length; i++)
                     ^
      3311.         a->coeff[i]*= scalar;
      3312. }

libswscale/swscale.c:3310:15: Loop condition is false. Leaving loop
      3308.     int i;
      3309. 
      3310.     for (i=0; i<a->length; i++)
                          ^
      3311.         a->coeff[i]*= scalar;
      3312. }

libswscale/swscale.c:3312:1: return from a call to sws_scaleVec
      3310.     for (i=0; i<a->length; i++)
      3311.         a->coeff[i]*= scalar;
      3312. }
            ^
      3313. 
      3314. void sws_normalizeVec(SwsVector *a, double height)

libswscale/swscale.c:3317:1: return from a call to sws_normalizeVec
    3315. {
    3316.     sws_scaleVec(a, height/sws_dcVec(a));
    3317. }
          ^
    3318. 
    3319. static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b)

libswscale/swscale.c:3272:5: 
  3270.     sws_normalizeVec(vec, 1.0);
  3271. 
  3272.     return vec;
            ^
  3273. }
  3274. 

libswscale/swscale.c:3273:1: return from a call to sws_getGaussianVec
  3271. 
  3272.     return vec;
  3273. }
        ^
  3274. 
  3275. SwsVector *sws_getConstVec(double c, int length)

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_getGaussianVec(double variance, double quality)\n{\n    const int length= (int)(variance*quality + 0.5) | 1;\n    int i;\n    double middle= (length-1)*0.5;\n    SwsVector *vec= sws_allocVec(length);\n    if (!vec)\n        return NULL;\n    for (i=0; i<length; i++) {\n        double dist= i-middle;\n        vec->coeff[i]= exp(-dist*dist/(2*variance*variance)) / sqrt(2*variance*PI);\n    }\n    sws_normalizeVec(vec, 1.0);\n    return vec;\n}', 'void sws_normalizeVec(SwsVector *a, double height)\n{\n    sws_scaleVec(a, height/sws_dcVec(a));\n}', 'double sws_dcVec(SwsVector *a)\n{\n    int i;\n    double sum=0;\n    for (i=0; i<a->length; i++)\n        sum+= a->coeff[i];\n    return sum;\n}', 'void sws_scaleVec(SwsVector *a, double scalar)\n{\n    int i;\n    for (i=0; i<a->length; i++)\n        a->coeff[i]*= scalar;\n}']