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

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

libavfilter/drawutils.c:30:5: 
28.                             int *is_packed_rgba, uint8_t rgba_map_ptr[4])
29. {
30.     uint8_t rgba_map[4] = {0};
        ^
31.     int i;
32.     const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];

libavfilter/drawutils.c:32:5: 
30.     uint8_t rgba_map[4] = {0};
31.     int i;
32.     const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
        ^
33.     int hsub = pix_desc->log2_chroma_w;
34. 

libavfilter/drawutils.c:33:5: 
31.     int i;
32.     const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
33.     int hsub = pix_desc->log2_chroma_w;
        ^
34. 
35.     *is_packed_rgba = 1;

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

libavfilter/drawutils.c:36:5: 
34. 
35.     *is_packed_rgba = 1;
36.     switch (pix_fmt) {
        ^
37.     case PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
38.     case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;

libavfilter/drawutils.c:37:5: Switch condition is false. Skipping switch case
35.     *is_packed_rgba = 1;
36.     switch (pix_fmt) {
37.     case PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
        ^
38.     case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
39.     case PIX_FMT_RGBA:

libavfilter/drawutils.c:38:5: Switch condition is false. Skipping switch case
36.     switch (pix_fmt) {
37.     case PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
38.     case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
        ^
39.     case PIX_FMT_RGBA:
40.     case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;

libavfilter/drawutils.c:39:5: Switch condition is false. Skipping switch case
37.     case PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
38.     case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
39.     case PIX_FMT_RGBA:
        ^
40.     case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
41.     case PIX_FMT_BGRA:

libavfilter/drawutils.c:40:5: Switch condition is false. Skipping switch case
38.     case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
39.     case PIX_FMT_RGBA:
40.     case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
        ^
41.     case PIX_FMT_BGRA:
42.     case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;

libavfilter/drawutils.c:41:5: Switch condition is false. Skipping switch case
39.     case PIX_FMT_RGBA:
40.     case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
41.     case PIX_FMT_BGRA:
        ^
42.     case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
43.     default:

libavfilter/drawutils.c:42:5: Switch condition is false. Skipping switch case
40.     case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
41.     case PIX_FMT_BGRA:
42.     case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
        ^
43.     default:
44.         *is_packed_rgba = 0;

libavfilter/drawutils.c:44:9: 
42.     case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
43.     default:
44.         *is_packed_rgba = 0;
            ^
45.     }
46. 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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:72:13: 
70.             line_size = (w >> hsub1) * pixel_step[plane];
71.             line[plane] = av_malloc(line_size);
72.             memset(line[plane], dst_color[plane], line_size);
                ^
73.         }
74.     }
