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

libswscale/swscale.c:3171:1: start of procedure sws_getDefaultFilter()
3169. #endif
3170. 
3171. SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
      ^
3172.                                 float lumaSharpen, float chromaSharpen,
3173.                                 float chromaHShift, float chromaVShift,

libswscale/swscale.c:3176:5: 
3174.                                 int verbose)
3175. {
3176.     SwsFilter *filter= av_malloc(sizeof(SwsFilter));
          ^
3177. 
3178.     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:3178:9: Taking false branch
3176.     SwsFilter *filter= av_malloc(sizeof(SwsFilter));
3177. 
3178.     if (lumaGBlur!=0.0){
              ^
3179.         filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);
3180.         filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);

libswscale/swscale.c:3182:9: 
3180.         filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);
3181.     }else{
3182.         filter->lumH= sws_getIdentityVec();
              ^
3183.         filter->lumV= sws_getIdentityVec();
3184.     }

libswscale/swscale.c:3265:1: start of procedure sws_getIdentityVec()
  3263. 
  3264. 
  3265. SwsVector *sws_getIdentityVec(void){
        ^
  3266.     return sws_getConstVec(1.0, 1);
  3267. }

libswscale/swscale.c:3266:5: Skipping sws_getConstVec(): empty list of specs
  3264. 
  3265. SwsVector *sws_getIdentityVec(void){
  3266.     return sws_getConstVec(1.0, 1);
            ^
  3267. }
  3268. 

libswscale/swscale.c:3267:1: return from a call to sws_getIdentityVec
  3265. SwsVector *sws_getIdentityVec(void){
  3266.     return sws_getConstVec(1.0, 1);
  3267. }
        ^
  3268. 
  3269. 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    return sws_getConstVec(1.0, 1);\n}']