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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

libavcodec/vp9block.c:1272:13: 
1270.             }
1271.         } else {
1272.             av_assert2(b->bs == BS_4x4);
                  ^
1273. 
1274.             // FIXME if two horizontally adjacent blocks have the same MV,

libavcodec/vp9block.c:1276:13: Skipping mc_luma_dir(): empty list of specs
1274.             // FIXME if two horizontally adjacent blocks have the same MV,
1275.             // do a w8 instead of a w4 call
1276.             mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y,
                  ^
1277.                         ref1->data[0], ref1->linesize[0],
1278.                         row << 3, col << 3, &b->mv[0][0], 4, 4, w, h);

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

libavcodec/vp9block.c:1282:13: Skipping mc_luma_dir(): empty list of specs
1280.                         ref1->data[0], ref1->linesize[0],
1281.                         row << 3, (col << 3) + 4, &b->mv[1][0], 4, 4, w, h);
1282.             mc_luma_dir(s, s->dsp.mc[4][b->filter][0],
                  ^
1283.                         b->dst[0] + 4 * ls_y, ls_y,
1284.                         ref1->data[0], ref1->linesize[0],

libavcodec/vp9block.c:1286:13: Skipping mc_luma_dir(): empty list of specs
1284.                         ref1->data[0], ref1->linesize[0],
1285.                         (row << 3) + 4, col << 3, &b->mv[2][0], 4, 4, w, h);
1286.             mc_luma_dir(s, s->dsp.mc[4][b->filter][0],
                  ^
1287.                         b->dst[0] + 4 * ls_y + 4, ls_y,
1288.                         ref1->data[0], ref1->linesize[0],

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

libavcodec/vp9block.c:1292:17: 
1290. 
1291.             if (b->comp) {
1292.                 mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y,
                      ^
1293.                             ref2->data[0], ref2->linesize[0],
1294.                             row << 3, col << 3, &b->mv[0][1], 4, 4, w, h);
