libavcodec/imgconvert.c:1416: error: Null Dereference
  pointer `buf` last assigned on line 1413 could be null and is dereferenced by call to `memcpy()` at line 1416, column 5.

libavcodec/imgconvert.c:1407:1: start of procedure deinterlace_bottom_field_inplace()
1405. }
1406. 
1407. static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
      ^
1408.                                              int width, int height)
1409. {

libavcodec/imgconvert.c:1413:5: 
1411.     int y;
1412.     uint8_t *buf;
1413.     buf = (uint8_t*)av_malloc(width);
          ^
1414. 
1415.     src_m1 = src1;

libavutil/mem.c:64:1: start of procedure av_malloc()
  62.    linker will do it automatically. */
  63. 
  64. void *av_malloc(unsigned int size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(unsigned int size)
  65. {
  66.     void *ptr = NULL;
          ^
  67. #if CONFIG_MEMALIGN_HACK
  68.     long diff;

libavutil/mem.c:72:8: Taking true branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-16) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:73:9: 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-16) )
  73.         return NULL;
              ^
  74. 
  75. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:117:1: return from a call to av_malloc
  115. #endif
  116.     return ptr;
  117. }
       ^
  118. 
  119. void *av_realloc(void *ptr, unsigned int size)

libavcodec/imgconvert.c:1415:5: 
1413.     buf = (uint8_t*)av_malloc(width);
1414. 
1415.     src_m1 = src1;
          ^
1416.     memcpy(buf,src_m1,width);
1417.     src_0=&src_m1[src_wrap];

libavcodec/imgconvert.c:1416:5: 
1414. 
1415.     src_m1 = src1;
1416.     memcpy(buf,src_m1,width);
          ^
1417.     src_0=&src_m1[src_wrap];
1418.     src_p1=&src_0[src_wrap];

static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
                                             int width, int height)
{
    uint8_t *src_m1, *src_0, *src_p1, *src_p2;
    int y;
    uint8_t *buf;
    buf = (uint8_t*)av_malloc(width);
    src_m1 = src1;
    memcpy(buf,src_m1,width);
    src_0=&src_m1[src_wrap];
    src_p1=&src_0[src_wrap];
    src_p2=&src_p1[src_wrap];
    for(y=0;y<(height-2);y+=2) {
        deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width);
        src_m1 = src_p1;
        src_0 = src_p2;
        src_p1 += 2*src_wrap;
        src_p2 += 2*src_wrap;
    }
    deinterlace_line_inplace(buf,src_m1,src_0,src_0,src_0,width);
    av_free(buf);
}
['static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,\n                                             int width, int height)\n{\n    uint8_t *src_m1, *src_0, *src_p1, *src_p2;\n    int y;\n    uint8_t *buf;\n    buf = (uint8_t*)av_malloc(width);\n    src_m1 = src1;\n    memcpy(buf,src_m1,width);\n    src_0=&src_m1[src_wrap];\n    src_p1=&src_0[src_wrap];\n    src_p2=&src_p1[src_wrap];\n    for(y=0;y<(height-2);y+=2) {\n        deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width);\n        src_m1 = src_p1;\n        src_0 = src_p2;\n        src_p1 += 2*src_wrap;\n        src_p2 += 2*src_wrap;\n    }\n    deinterlace_line_inplace(buf,src_m1,src_0,src_0,src_0,width);\n    av_free(buf);\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}']