libavcodec/vp8.c:231: error: Null Dereference
  pointer `s->intra4x4_pred_mode_base` last assigned on line 225 could be null and is dereferenced by call to `memset()` at line 231, column 5.

libavcodec/vp8.c:205:1: start of procedure update_dimensions()
203. }
204. 
205. static int update_dimensions(VP8Context *s, int width, int height)
     ^
206. {
207.     int i;

libavcodec/vp8.c:209:9: 
207.     int i;
208. 
209.     if (avcodec_check_dimensions(s->avctx, width, height))
             ^
210.         return AVERROR_INVALIDDATA;
211. 

libavcodec/utils.c:222:1: start of procedure avcodec_check_dimensions()
  220. }
  221. 
  222. int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
       ^
  223.     if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
  224.         return 0;

libavcodec/utils.c:223:8: Taking true branch
  221. 
  222. int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
  223.     if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
              ^
  224.         return 0;
  225. 

libavcodec/utils.c:223:20: Taking true branch
  221. 
  222. int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
  223.     if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
                          ^
  224.         return 0;
  225. 

libavcodec/utils.c:223:32: Taking true branch
  221. 
  222. int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
  223.     if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
                                      ^
  224.         return 0;
  225. 

libavcodec/utils.c:224:9: 
  222. int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
  223.     if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
  224.         return 0;
               ^
  225. 
  226.     av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);

libavcodec/utils.c:228:1: return from a call to avcodec_check_dimensions
  226.     av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);
  227.     return AVERROR(EINVAL);
  228. }
       ^
  229. 
  230. int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){

libavcodec/vp8.c:209:9: Taking false branch
207.     int i;
208. 
209.     if (avcodec_check_dimensions(s->avctx, width, height))
             ^
210.         return AVERROR_INVALIDDATA;
211. 

libavcodec/vp8.c:212:5: Skipping vp8_decode_flush(): empty list of specs
210.         return AVERROR_INVALIDDATA;
211. 
212.     vp8_decode_flush(s->avctx);
         ^
213. 
214.     avcodec_set_dimensions(s->avctx, width, height);

libavcodec/vp8.c:214:5: 
212.     vp8_decode_flush(s->avctx);
213. 
214.     avcodec_set_dimensions(s->avctx, width, height);
         ^
215. 
216.     s->mb_width  = (s->avctx->coded_width +15) / 16;

libavcodec/utils.c:109:1: start of procedure avcodec_set_dimensions()
  107. }
  108. 
  109. void avcodec_set_dimensions(AVCodecContext *s, int width, int height){
       ^
  110.     s->coded_width = width;
  111.     s->coded_height= height;

libavcodec/utils.c:110:5: 
  108. 
  109. void avcodec_set_dimensions(AVCodecContext *s, int width, int height){
  110.     s->coded_width = width;
           ^
  111.     s->coded_height= height;
  112.     s->width = -((-width )>>s->lowres);

libavcodec/utils.c:111:5: 
  109. void avcodec_set_dimensions(AVCodecContext *s, int width, int height){
  110.     s->coded_width = width;
  111.     s->coded_height= height;
           ^
  112.     s->width = -((-width )>>s->lowres);
  113.     s->height= -((-height)>>s->lowres);

libavcodec/utils.c:112:5: 
  110.     s->coded_width = width;
  111.     s->coded_height= height;
  112.     s->width = -((-width )>>s->lowres);
           ^
  113.     s->height= -((-height)>>s->lowres);
  114. }

libavcodec/utils.c:113:5: 
  111.     s->coded_height= height;
  112.     s->width = -((-width )>>s->lowres);
  113.     s->height= -((-height)>>s->lowres);
           ^
  114. }
  115. 

libavcodec/utils.c:114:1: return from a call to avcodec_set_dimensions
  112.     s->width = -((-width )>>s->lowres);
  113.     s->height= -((-height)>>s->lowres);
  114. }
       ^
  115. 
  116. typedef struct InternalBuffer{

libavcodec/vp8.c:216:5: 
214.     avcodec_set_dimensions(s->avctx, width, height);
215. 
216.     s->mb_width  = (s->avctx->coded_width +15) / 16;
         ^
217.     s->mb_height = (s->avctx->coded_height+15) / 16;
218. 

libavcodec/vp8.c:217:5: 
215. 
216.     s->mb_width  = (s->avctx->coded_width +15) / 16;
217.     s->mb_height = (s->avctx->coded_height+15) / 16;
         ^
218. 
219.     // we allocate a border around the top/left of intra4x4 modes

libavcodec/vp8.c:221:5: 
219.     // we allocate a border around the top/left of intra4x4 modes
220.     // this is 4 blocks for intra4x4 to keep 4-byte alignment for fill_rectangle
221.     s->mb_stride = s->mb_width+1;
         ^
222.     s->b4_stride = 4*s->mb_stride;
223. 

libavcodec/vp8.c:222:5: 
220.     // this is 4 blocks for intra4x4 to keep 4-byte alignment for fill_rectangle
221.     s->mb_stride = s->mb_width+1;
222.     s->b4_stride = 4*s->mb_stride;
         ^
223. 
224.     s->macroblocks_base        = av_mallocz(s->mb_stride*(s->mb_height+1)*sizeof(*s->macroblocks));

libavcodec/vp8.c:224:5: 
222.     s->b4_stride = 4*s->mb_stride;
223. 
224.     s->macroblocks_base        = av_mallocz(s->mb_stride*(s->mb_height+1)*sizeof(*s->macroblocks));
         ^
225.     s->intra4x4_pred_mode_base = av_mallocz(s->b4_stride*(4*s->mb_height+1));
226.     s->top_nnz                 = av_mallocz(s->mb_width*sizeof(*s->top_nnz));

libavutil/mem.c:157:1: start of procedure av_mallocz()
  155. }
  156. 
  157. void *av_mallocz(unsigned int size)
       ^
  158. {
  159.     void *ptr = av_malloc(size);

libavutil/mem.c:159:5: 
  157. void *av_mallocz(unsigned int size)
  158. {
  159.     void *ptr = av_malloc(size);
           ^
  160.     if (ptr)
  161.         memset(ptr, 0, size);

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)

libavutil/mem.c:160:9: Taking false branch
  158. {
  159.     void *ptr = av_malloc(size);
  160.     if (ptr)
               ^
  161.         memset(ptr, 0, size);
  162.     return ptr;

libavutil/mem.c:162:5: 
  160.     if (ptr)
  161.         memset(ptr, 0, size);
  162.     return ptr;
           ^
  163. }
  164. 

libavutil/mem.c:163:1: return from a call to av_mallocz
  161.         memset(ptr, 0, size);
  162.     return ptr;
  163. }
       ^
  164. 
  165. char *av_strdup(const char *s)

libavcodec/vp8.c:225:5: 
223. 
224.     s->macroblocks_base        = av_mallocz(s->mb_stride*(s->mb_height+1)*sizeof(*s->macroblocks));
225.     s->intra4x4_pred_mode_base = av_mallocz(s->b4_stride*(4*s->mb_height+1));
         ^
226.     s->top_nnz                 = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
227. 

libavutil/mem.c:157:1: start of procedure av_mallocz()
  155. }
  156. 
  157. void *av_mallocz(unsigned int size)
       ^
  158. {
  159.     void *ptr = av_malloc(size);

libavutil/mem.c:159:5: 
  157. void *av_mallocz(unsigned int size)
  158. {
  159.     void *ptr = av_malloc(size);
           ^
  160.     if (ptr)
  161.         memset(ptr, 0, size);

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)

libavutil/mem.c:160:9: Taking false branch
  158. {
  159.     void *ptr = av_malloc(size);
  160.     if (ptr)
               ^
  161.         memset(ptr, 0, size);
  162.     return ptr;

libavutil/mem.c:162:5: 
  160.     if (ptr)
  161.         memset(ptr, 0, size);
  162.     return ptr;
           ^
  163. }
  164. 

libavutil/mem.c:163:1: return from a call to av_mallocz
  161.         memset(ptr, 0, size);
  162.     return ptr;
  163. }
       ^
  164. 
  165. char *av_strdup(const char *s)

libavcodec/vp8.c:226:5: 
224.     s->macroblocks_base        = av_mallocz(s->mb_stride*(s->mb_height+1)*sizeof(*s->macroblocks));
225.     s->intra4x4_pred_mode_base = av_mallocz(s->b4_stride*(4*s->mb_height+1));
226.     s->top_nnz                 = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
         ^
227. 
228.     s->macroblocks        = s->macroblocks_base        + 1 + s->mb_stride;

libavutil/mem.c:157:1: start of procedure av_mallocz()
  155. }
  156. 
  157. void *av_mallocz(unsigned int size)
       ^
  158. {
  159.     void *ptr = av_malloc(size);

libavutil/mem.c:159:5: 
  157. void *av_mallocz(unsigned int size)
  158. {
  159.     void *ptr = av_malloc(size);
           ^
  160.     if (ptr)
  161.         memset(ptr, 0, size);

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)

libavutil/mem.c:160:9: Taking false branch
  158. {
  159.     void *ptr = av_malloc(size);
  160.     if (ptr)
               ^
  161.         memset(ptr, 0, size);
  162.     return ptr;

libavutil/mem.c:162:5: 
  160.     if (ptr)
  161.         memset(ptr, 0, size);
  162.     return ptr;
           ^
  163. }
  164. 

libavutil/mem.c:163:1: return from a call to av_mallocz
  161.         memset(ptr, 0, size);
  162.     return ptr;
  163. }
       ^
  164. 
  165. char *av_strdup(const char *s)

libavcodec/vp8.c:228:5: 
226.     s->top_nnz                 = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
227. 
228.     s->macroblocks        = s->macroblocks_base        + 1 + s->mb_stride;
         ^
229.     s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;
230. 

libavcodec/vp8.c:229:5: 
227. 
228.     s->macroblocks        = s->macroblocks_base        + 1 + s->mb_stride;
229.     s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;
         ^
230. 
231.     memset(s->intra4x4_pred_mode_base, DC_PRED, s->b4_stride);

libavcodec/vp8.c:231:5: 
229.     s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;
230. 
231.     memset(s->intra4x4_pred_mode_base, DC_PRED, s->b4_stride);
         ^
232.     for (i = 0; i < 4*s->mb_height; i++)
233.         s->intra4x4_pred_mode[i*s->b4_stride-1] = DC_PRED;
