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

libswscale/swscale.c:3291:1: start of procedure sws_getGaussianVec()
3289. }
3290. 
3291. SwsVector *sws_getGaussianVec(double variance, double quality){
      ^
3292.     const int length= (int)(variance*quality + 0.5) | 1;
3293.     int i;

libswscale/swscale.c:3292:5: 
3290. 
3291. SwsVector *sws_getGaussianVec(double variance, double quality){
3292.     const int length= (int)(variance*quality + 0.5) | 1;
          ^
3293.     int i;
3294.     double *coeff= av_malloc(length*sizeof(double));

libswscale/swscale.c:3294:5: 
3292.     const int length= (int)(variance*quality + 0.5) | 1;
3293.     int i;
3294.     double *coeff= av_malloc(length*sizeof(double));
          ^
3295.     double middle= (length-1)*0.5;
3296.     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:3295:5: 
3293.     int i;
3294.     double *coeff= av_malloc(length*sizeof(double));
3295.     double middle= (length-1)*0.5;
          ^
3296.     SwsVector *vec= av_malloc(sizeof(SwsVector));
3297. 

libswscale/swscale.c:3296:5: 
3294.     double *coeff= av_malloc(length*sizeof(double));
3295.     double middle= (length-1)*0.5;
3296.     SwsVector *vec= av_malloc(sizeof(SwsVector));
          ^
3297. 
3298.     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:3298:5: 
3296.     SwsVector *vec= av_malloc(sizeof(SwsVector));
3297. 
3298.     vec->coeff= coeff;
          ^
3299.     vec->length= length;
3300. 

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