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

libavfilter/vf_pad.c:34:1: start of procedure fill_line_with_color()
32. enum { RED = 0, GREEN, BLUE, ALPHA };
33. 
34. static int fill_line_with_color(uint8_t *line[4], int line_step[4], int w, uint8_t color[4],
    ^
35.                                 enum PixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba)
36. {

libavfilter/vf_pad.c:37:5: 
35.                                 enum PixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba)
36. {
37.     uint8_t rgba_map[4] = {0};
        ^
38.     int i;
39.     const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];

libavfilter/vf_pad.c:39:5: 
37.     uint8_t rgba_map[4] = {0};
38.     int i;
39.     const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
        ^
40.     int hsub = pix_desc->log2_chroma_w;
41. 

libavfilter/vf_pad.c:40:5: 
38.     int i;
39.     const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
40.     int hsub = pix_desc->log2_chroma_w;
        ^
41. 
42.     *is_packed_rgba = 1;

libavfilter/vf_pad.c:42:5: 
40.     int hsub = pix_desc->log2_chroma_w;
41. 
42.     *is_packed_rgba = 1;
        ^
43.     switch (pix_fmt) {
44.     case PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;

libavfilter/vf_pad.c:43:5: 
41. 
42.     *is_packed_rgba = 1;
43.     switch (pix_fmt) {
        ^
44.     case PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
45.     case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;

libavfilter/vf_pad.c:44:5: Switch condition is false. Skipping switch case
42.     *is_packed_rgba = 1;
43.     switch (pix_fmt) {
44.     case PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
        ^
45.     case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
46.     case PIX_FMT_RGBA:

libavfilter/vf_pad.c:45:5: Switch condition is false. Skipping switch case
43.     switch (pix_fmt) {
44.     case PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
45.     case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
        ^
46.     case PIX_FMT_RGBA:
47.     case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;

libavfilter/vf_pad.c:46:5: Switch condition is false. Skipping switch case
44.     case PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
45.     case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
46.     case PIX_FMT_RGBA:
        ^
47.     case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
48.     case PIX_FMT_BGRA:

libavfilter/vf_pad.c:47:5: Switch condition is false. Skipping switch case
45.     case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
46.     case PIX_FMT_RGBA:
47.     case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
        ^
48.     case PIX_FMT_BGRA:
49.     case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;

libavfilter/vf_pad.c:48:5: Switch condition is false. Skipping switch case
46.     case PIX_FMT_RGBA:
47.     case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
48.     case PIX_FMT_BGRA:
        ^
49.     case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
50.     default:

libavfilter/vf_pad.c:49:5: Switch condition is false. Skipping switch case
47.     case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
48.     case PIX_FMT_BGRA:
49.     case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
        ^
50.     default:
51.         *is_packed_rgba = 0;

libavfilter/vf_pad.c:51:9: 
49.     case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
50.     default:
51.         *is_packed_rgba = 0;
            ^
52.     }
53. 

libavfilter/vf_pad.c:54:9: Taking false branch
52.     }
53. 
54.     if (*is_packed_rgba) {
            ^
55.         line_step[0] = (av_get_bits_per_pixel(pix_desc))>>3;
56.         for (i = 0; i < 4; i++)

libavfilter/vf_pad.c:65:9: 
63.         int plane;
64. 
65.         color[RED  ] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]);
            ^
66.         color[GREEN] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
67.         color[BLUE ] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);

libavfilter/vf_pad.c:66:9: 
64. 
65.         color[RED  ] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]);
66.         color[GREEN] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
            ^
67.         color[BLUE ] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
68.         color[ALPHA] = rgba_color[3];

libavfilter/vf_pad.c:67:9: 
65.         color[RED  ] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]);
66.         color[GREEN] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
67.         color[BLUE ] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
            ^
68.         color[ALPHA] = rgba_color[3];
69. 

libavfilter/vf_pad.c:68:9: 
66.         color[GREEN] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
67.         color[BLUE ] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
68.         color[ALPHA] = rgba_color[3];
            ^
69. 
70.         for (plane = 0; plane < 4; plane++) {

libavfilter/vf_pad.c:70:14: 
68.         color[ALPHA] = rgba_color[3];
69. 
70.         for (plane = 0; plane < 4; plane++) {
                 ^
71.             int line_size;
72.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;

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

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

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

libavfilter/vf_pad.c:72:25: 
70.         for (plane = 0; plane < 4; plane++) {
71.             int line_size;
72.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
                            ^
73. 
74.             line_step[plane] = 1;

libavfilter/vf_pad.c:72:13: 
70.         for (plane = 0; plane < 4; plane++) {
71.             int line_size;
72.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
                ^
73. 
74.             line_step[plane] = 1;

libavfilter/vf_pad.c:74:13: 
72.             int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
73. 
74.             line_step[plane] = 1;
                ^
75.             line_size = (w >> hsub1) * line_step[plane];
76.             line[plane] = av_malloc(line_size);

libavfilter/vf_pad.c:75:13: 
73. 
74.             line_step[plane] = 1;
75.             line_size = (w >> hsub1) * line_step[plane];
                ^
76.             line[plane] = av_malloc(line_size);
77.             memset(line[plane], color[plane], line_size);

libavfilter/vf_pad.c:76:13: 
74.             line_step[plane] = 1;
75.             line_size = (w >> hsub1) * line_step[plane];
76.             line[plane] = av_malloc(line_size);
                ^
77.             memset(line[plane], color[plane], line_size);
78.         }

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)

libavfilter/vf_pad.c:77:13: 
75.             line_size = (w >> hsub1) * line_step[plane];
76.             line[plane] = av_malloc(line_size);
77.             memset(line[plane], color[plane], line_size);
                ^
78.         }
79.     }
