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

libswscale/swscale.c:2830:1: start of procedure sws_getDefaultFilter()
2828. #endif
2829. 
2830. SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
      ^
2831.                                 float lumaSharpen, float chromaSharpen,
2832.                                 float chromaHShift, float chromaVShift,

libswscale/swscale.c:2835:5: 
2833.                                 int verbose)
2834. {
2835.     SwsFilter *filter= av_malloc(sizeof(SwsFilter));
          ^
2836. 
2837.     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:2837:9: Taking true branch
2835.     SwsFilter *filter= av_malloc(sizeof(SwsFilter));
2836. 
2837.     if (lumaGBlur!=0.0){
              ^
2838.         filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);
2839.         filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);

libswscale/swscale.c:2838:9: Skipping sws_getGaussianVec(): empty list of specs
2836. 
2837.     if (lumaGBlur!=0.0){
2838.         filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);
              ^
2839.         filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);
2840.     }else{

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}']