libavcodec/vp9block.c:1266: error: Null Dereference
  pointer `ref2` last assigned on line 1229 could be null and is dereferenced at line 1266, column 29.

libavcodec/vp9block.c:1219:1: start of procedure inter_recon()
1217. }
1218. 
1219. static int inter_recon(AVCodecContext *avctx)
      ^
1220. {
1221.     static const uint8_t bwlog_tab[2][N_BS_SIZES] = {

libavcodec/vp9block.c:1221:5: 
1219. static int inter_recon(AVCodecContext *avctx)
1220. {
1221.     static const uint8_t bwlog_tab[2][N_BS_SIZES] = {
          ^
1222.         { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
1223.         { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 },

libavcodec/vp9block.c:1225:5: 
1223.         { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 },
1224.     };
1225.     VP9Context *s = avctx->priv_data;
          ^
1226.     VP9Block *const b = &s->b;
1227.     int row = b->row, col = b->col;

libavcodec/vp9block.c:1226:5: 
1224.     };
1225.     VP9Context *s = avctx->priv_data;
1226.     VP9Block *const b = &s->b;
          ^
1227.     int row = b->row, col = b->col;
1228.     AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]];

libavcodec/vp9block.c:1227:5: 
1225.     VP9Context *s = avctx->priv_data;
1226.     VP9Block *const b = &s->b;
1227.     int row = b->row, col = b->col;
          ^
1228.     AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]];
1229.     AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL;

libavcodec/vp9block.c:1228:5: 
1226.     VP9Block *const b = &s->b;
1227.     int row = b->row, col = b->col;
1228.     AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]];
          ^
1229.     AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL;
1230.     int w = avctx->width, h = avctx->height;

libavcodec/vp9block.c:1229:21: Condition is false
1227.     int row = b->row, col = b->col;
1228.     AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]];
1229.     AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL;
                          ^
1230.     int w = avctx->width, h = avctx->height;
1231.     ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride;

libavcodec/vp9block.c:1229:5: 
1227.     int row = b->row, col = b->col;
1228.     AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]];
1229.     AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL;
          ^
1230.     int w = avctx->width, h = avctx->height;
1231.     ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride;

libavcodec/vp9block.c:1230:5: 
1228.     AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]];
1229.     AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL;
1230.     int w = avctx->width, h = avctx->height;
          ^
1231.     ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride;
1232. 

libavcodec/vp9block.c:1231:5: 
1229.     AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL;
1230.     int w = avctx->width, h = avctx->height;
1231.     ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride;
          ^
1232. 
1233.     if (!ref1->data[0] || (b->comp && !ref2->data[0]))

libavcodec/vp9block.c:1233:10: Taking false branch
1231.     ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride;
1232. 
1233.     if (!ref1->data[0] || (b->comp && !ref2->data[0]))
               ^
1234.         return AVERROR_INVALIDDATA;
1235. 

libavcodec/vp9block.c:1233:28: Taking false branch
1231.     ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride;
1232. 
1233.     if (!ref1->data[0] || (b->comp && !ref2->data[0]))
                                 ^
1234.         return AVERROR_INVALIDDATA;
1235. 

libavcodec/vp9block.c:1237:9: Taking true branch
1235. 
1236.     // y inter pred
1237.     if (b->bs > BS_8x8) {
              ^
1238.         if (b->bs == BS_8x4) {
1239.             mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0], ls_y,

libavcodec/vp9block.c:1238:13: Taking false branch
1236.     // y inter pred
1237.     if (b->bs > BS_8x8) {
1238.         if (b->bs == BS_8x4) {
                  ^
1239.             mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0], ls_y,
1240.                         ref1->data[0], ref1->linesize[0],

libavcodec/vp9block.c:1256:20: Taking true branch
1254.                             (row << 3) + 4, col << 3, &b->mv[2][1], 8, 4, w, h);
1255.             }
1256.         } else if (b->bs == BS_4x8) {
                         ^
1257.             mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y,
1258.                         ref1->data[0], ref1->linesize[0],

libavcodec/vp9block.c:1257:13: Skipping mc_luma_dir(): empty list of specs
1255.             }
1256.         } else if (b->bs == BS_4x8) {
1257.             mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y,
                  ^
1258.                         ref1->data[0], ref1->linesize[0],
1259.                         row << 3, col << 3, &b->mv[0][0], 4, 8, w, h);

libavcodec/vp9block.c:1260:13: Skipping mc_luma_dir(): empty list of specs
1258.                         ref1->data[0], ref1->linesize[0],
1259.                         row << 3, col << 3, &b->mv[0][0], 4, 8, w, h);
1260.             mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4, ls_y,
                  ^
1261.                         ref1->data[0], ref1->linesize[0],
1262.                         row << 3, (col << 3) + 4, &b->mv[1][0], 4, 8, w, h);

libavcodec/vp9block.c:1264:17: Taking true branch
1262.                         row << 3, (col << 3) + 4, &b->mv[1][0], 4, 8, w, h);
1263. 
1264.             if (b->comp) {
                      ^
1265.                 mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y,
1266.                             ref2->data[0], ref2->linesize[0],

libavcodec/vp9block.c:1265:17: 
1263. 
1264.             if (b->comp) {
1265.                 mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y,
                      ^
1266.                             ref2->data[0], ref2->linesize[0],
1267.                             row << 3, col << 3, &b->mv[0][1], 4, 8, w, h);
