libavfilter/drawutils.c:75: error: Null Dereference
  pointer `*line[plane]` last assigned on line 74 could be null and is dereferenced by call to `memset()` at line 75, column 13.

libavfilter/drawutils.c:29:1: start of procedure ff_fill_line_with_color()
27. enum { RED = 0, GREEN, BLUE, ALPHA };
28. 
29. int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4],
    ^
30.                             enum AVPixelFormat pix_fmt, uint8_t rgba_color[4],
31.                             int *is_packed_rgba, uint8_t rgba_map_ptr[4])

libavfilter/drawutils.c:33:5: 
31.                             int *is_packed_rgba, uint8_t rgba_map_ptr[4])
32. {
33.     uint8_t rgba_map[4] = {0};
        ^
34.     int i;
35.     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);

libavfilter/drawutils.c:35:5: 
33.     uint8_t rgba_map[4] = {0};
34.     int i;
35.     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
        ^
36.     int hsub = pix_desc->log2_chroma_w;
37. 

libavutil/pixdesc.c:1199:1: start of procedure av_pix_fmt_desc_get()
  1197. }
  1198. 
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1201:9: Taking false branch
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1201:24: Taking false branch
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1203:5: 
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];
            ^
  1204. }
  1205. 

libavutil/pixdesc.c:1204:1: return from a call to av_pix_fmt_desc_get
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];
  1204. }
        ^
  1205. 
  1206. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavfilter/drawutils.c:36:5: 
34.     int i;
35.     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
36.     int hsub = pix_desc->log2_chroma_w;
        ^
37. 
38.     *is_packed_rgba = 1;

libavfilter/drawutils.c:38:5: 
36.     int hsub = pix_desc->log2_chroma_w;
37. 
38.     *is_packed_rgba = 1;
        ^
39.     switch (pix_fmt) {
40.     case AV_PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;

libavfilter/drawutils.c:39:5: 
37. 
38.     *is_packed_rgba = 1;
39.     switch (pix_fmt) {
        ^
40.     case AV_PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
41.     case AV_PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;

libavfilter/drawutils.c:40:5: Switch condition is false. Skipping switch case
38.     *is_packed_rgba = 1;
39.     switch (pix_fmt) {
40.     case AV_PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
        ^
41.     case AV_PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
42.     case AV_PIX_FMT_RGBA:

libavfilter/drawutils.c:41:5: Switch condition is false. Skipping switch case
39.     switch (pix_fmt) {
40.     case AV_PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
41.     case AV_PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
        ^
42.     case AV_PIX_FMT_RGBA:
43.     case AV_PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;

libavfilter/drawutils.c:42:5: Switch condition is false. Skipping switch case
40.     case AV_PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
41.     case AV_PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
42.     case AV_PIX_FMT_RGBA:
        ^
43.     case AV_PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
44.     case AV_PIX_FMT_BGRA:

libavfilter/drawutils.c:43:5: Switch condition is false. Skipping switch case
41.     case AV_PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
42.     case AV_PIX_FMT_RGBA:
43.     case AV_PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
        ^
44.     case AV_PIX_FMT_BGRA:
45.     case AV_PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;

libavfilter/drawutils.c:44:5: Switch condition is false. Skipping switch case
42.     case AV_PIX_FMT_RGBA:
43.     case AV_PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
44.     case AV_PIX_FMT_BGRA:
        ^
45.     case AV_PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
46.     default:

libavfilter/drawutils.c:45:5: Switch condition is false. Skipping switch case
43.     case AV_PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
44.     case AV_PIX_FMT_BGRA:
45.     case AV_PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
        ^
46.     default:
47.         *is_packed_rgba = 0;

libavfilter/drawutils.c:47:9: 
45.     case AV_PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
46.     default:
47.         *is_packed_rgba = 0;
            ^
48.     }
49. 

libavfilter/drawutils.c:50:9: Taking false branch
48.     }
49. 
50.     if (*is_packed_rgba) {
            ^
51.         pixel_step[0] = (av_get_bits_per_pixel(pix_desc))>>3;
52.         for (i = 0; i < 4; i++)

libavfilter/drawutils.c:63:9: 
61.         int plane;
62. 
63.         dst_color[0] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]);
            ^
64.         dst_color[1] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
65.         dst_color[2] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);

libavfilter/drawutils.c:64:9: 
62. 
63.         dst_color[0] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]);
64.         dst_color[1] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
            ^
65.         dst_color[2] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
66.         dst_color[3] = rgba_color[3];

libavfilter/drawutils.c:65:9: 
63.         dst_color[0] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]);
64.         dst_color[1] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
65.         dst_color[2] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
            ^
66.         dst_color[3] = rgba_color[3];
67. 

libavfilter/drawutils.c:66:9: 
64.         dst_color[1] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
65.         dst_color[2] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
66.         dst_color[3] = rgba_color[3];
            ^
67. 
68.         for (plane = 0; plane < 4; plane++) {

libavfilter/drawutils.c:68:14: 
66.         dst_color[3] = rgba_color[3];
67. 
68.         for (plane = 0; plane < 4; plane++) {
                 ^
69.             int line_size;
70.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;

libavfilter/drawutils.c:68:25: Loop condition is true. Entering loop body
66.         dst_color[3] = rgba_color[3];
67. 
68.         for (plane = 0; plane < 4; plane++) {
                            ^
69.             int line_size;
70.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;

libavfilter/drawutils.c:70:26: Condition is false
68.         for (plane = 0; plane < 4; plane++) {
69.             int line_size;
70.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
                             ^
71. 
72.             pixel_step[plane] = 1;

libavfilter/drawutils.c:70:40: Condition is false
68.         for (plane = 0; plane < 4; plane++) {
69.             int line_size;
70.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
                                           ^
71. 
72.             pixel_step[plane] = 1;

libavfilter/drawutils.c:70:25: 
68.         for (plane = 0; plane < 4; plane++) {
69.             int line_size;
70.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
                            ^
71. 
72.             pixel_step[plane] = 1;

libavfilter/drawutils.c:70:13: 
68.         for (plane = 0; plane < 4; plane++) {
69.             int line_size;
70.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
                ^
71. 
72.             pixel_step[plane] = 1;

libavfilter/drawutils.c:72:13: 
70.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
71. 
72.             pixel_step[plane] = 1;
                ^
73.             line_size = (w >> hsub1) * pixel_step[plane];
74.             line[plane] = av_malloc(line_size);

libavfilter/drawutils.c:73:13: 
71. 
72.             pixel_step[plane] = 1;
73.             line_size = (w >> hsub1) * pixel_step[plane];
                ^
74.             line[plane] = av_malloc(line_size);
75.             memset(line[plane], dst_color[plane], line_size);

libavfilter/drawutils.c:74:13: 
72.             pixel_step[plane] = 1;
73.             line_size = (w >> hsub1) * pixel_step[plane];
74.             line[plane] = av_malloc(line_size);
                ^
75.             memset(line[plane], dst_color[plane], line_size);
76.         }

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

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

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

libavutil/mem.c:73:9: 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
  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, size_t size)

libavfilter/drawutils.c:75:13: 
73.             line_size = (w >> hsub1) * pixel_step[plane];
74.             line[plane] = av_malloc(line_size);
75.             memset(line[plane], dst_color[plane], line_size);
                ^
76.         }
77.     }
