libswscale/swscale.c:2895: error: Null Dereference
  pointer `vec` last assigned on line 2893 could be null and is dereferenced at line 2895, column 5.

libswscale/swscale.c:2888:1: start of procedure sws_getGaussianVec()
2886. }
2887. 
2888. SwsVector *sws_getGaussianVec(double variance, double quality){
      ^
2889.     const int length= (int)(variance*quality + 0.5) | 1;
2890.     int i;

libswscale/swscale.c:2889:5: 
2887. 
2888. SwsVector *sws_getGaussianVec(double variance, double quality){
2889.     const int length= (int)(variance*quality + 0.5) | 1;
          ^
2890.     int i;
2891.     double *coeff= av_malloc(length*sizeof(double));

libswscale/swscale.c:2891:5: 
2889.     const int length= (int)(variance*quality + 0.5) | 1;
2890.     int i;
2891.     double *coeff= av_malloc(length*sizeof(double));
          ^
2892.     double middle= (length-1)*0.5;
2893.     SwsVector *vec= av_malloc(sizeof(SwsVector));

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 false 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: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:2892:5: 
2890.     int i;
2891.     double *coeff= av_malloc(length*sizeof(double));
2892.     double middle= (length-1)*0.5;
          ^
2893.     SwsVector *vec= av_malloc(sizeof(SwsVector));
2894. 

libswscale/swscale.c:2893:5: 
2891.     double *coeff= av_malloc(length*sizeof(double));
2892.     double middle= (length-1)*0.5;
2893.     SwsVector *vec= av_malloc(sizeof(SwsVector));
          ^
2894. 
2895.     vec->coeff= coeff;

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:2895:5: 
2893.     SwsVector *vec= av_malloc(sizeof(SwsVector));
2894. 
2895.     vec->coeff= coeff;
          ^
2896.     vec->length= length;
2897. 

SwsVector *sws_getGaussianVec(double variance, double quality){
    const int length= (int)(variance*quality + 0.5) | 1;
    int i;
    double *coeff= av_malloc(length*sizeof(double));
    double middle= (length-1)*0.5;
    SwsVector *vec= av_malloc(sizeof(SwsVector));
    vec->coeff= coeff;
    vec->length= length;
    for (i=0; i<length; i++)
    {
        double dist= i-middle;
        coeff[i]= exp(-dist*dist/(2*variance*variance)) / sqrt(2*variance*PI);
    }
    sws_normalizeVec(vec, 1.0);
    return vec;
}
['SwsVector *sws_getGaussianVec(double variance, double quality){\n    const int length= (int)(variance*quality + 0.5) | 1;\n    int i;\n    double *coeff= av_malloc(length*sizeof(double));\n    double middle= (length-1)*0.5;\n    SwsVector *vec= av_malloc(sizeof(SwsVector));\n    vec->coeff= coeff;\n    vec->length= length;\n    for (i=0; i<length; i++)\n    {\n        double dist= i-middle;\n        coeff[i]= exp(-dist*dist/(2*variance*variance)) / sqrt(2*variance*PI);\n    }\n    sws_normalizeVec(vec, 1.0);\n    return vec;\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}']