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

libswscale/swscale.c:3210:1: start of procedure sws_diffVec()
3208. }
3209. 
3210. static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
      ^
3211.     int length= FFMAX(a->length, b->length);
3212.     double *coeff= av_malloc(length*sizeof(double));

libswscale/swscale.c:3211:17: Condition is true
3209. 
3210. static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
3211.     int length= FFMAX(a->length, b->length);
                      ^
3212.     double *coeff= av_malloc(length*sizeof(double));
3213.     int i;

libswscale/swscale.c:3211:5: 
3209. 
3210. static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
3211.     int length= FFMAX(a->length, b->length);
          ^
3212.     double *coeff= av_malloc(length*sizeof(double));
3213.     int i;

libswscale/swscale.c:3212:5: 
3210. static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
3211.     int length= FFMAX(a->length, b->length);
3212.     double *coeff= av_malloc(length*sizeof(double));
          ^
3213.     int i;
3214.     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:3214:5: 
3212.     double *coeff= av_malloc(length*sizeof(double));
3213.     int i;
3214.     SwsVector *vec= av_malloc(sizeof(SwsVector));
          ^
3215. 
3216.     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:3216:5: 
3214.     SwsVector *vec= av_malloc(sizeof(SwsVector));
3215. 
3216.     vec->coeff= coeff;
          ^
3217.     vec->length= length;
3218. 

static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
    int length= FFMAX(a->length, b->length);
    double *coeff= av_malloc(length*sizeof(double));
    int i;
    SwsVector *vec= av_malloc(sizeof(SwsVector));
    vec->coeff= coeff;
    vec->length= length;
    for (i=0; i<length; i++) coeff[i]= 0.0;
    for (i=0; i<a->length; i++) coeff[i + (length-1)/2 - (a->length-1)/2]+= a->coeff[i];
    for (i=0; i<b->length; i++) coeff[i + (length-1)/2 - (b->length-1)/2]-= b->coeff[i];
    return vec;
}
['static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){\n    int length= FFMAX(a->length, b->length);\n    double *coeff= av_malloc(length*sizeof(double));\n    int i;\n    SwsVector *vec= av_malloc(sizeof(SwsVector));\n    vec->coeff= coeff;\n    vec->length= length;\n    for (i=0; i<length; i++) coeff[i]= 0.0;\n    for (i=0; i<a->length; i++) coeff[i + (length-1)/2 - (a->length-1)/2]+= a->coeff[i];\n    for (i=0; i<b->length; i++) coeff[i + (length-1)/2 - (b->length-1)/2]-= b->coeff[i];\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}']