diff options
Diffstat (limited to 'vp9/vp9_dx_iface.c')
-rw-r--r-- | vp9/vp9_dx_iface.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c index fa79f7aed..35ecbaff3 100644 --- a/vp9/vp9_dx_iface.c +++ b/vp9/vp9_dx_iface.c @@ -474,11 +474,15 @@ static vpx_codec_err_t ctrl_get_reference(vpx_codec_alg_priv_t *ctx, vp9_ref_frame_t *data = va_arg(args, vp9_ref_frame_t *); if (data) { - const int fb_idx = ctx->pbi->common.cur_show_frame_fb_idx; - YV12_BUFFER_CONFIG *fb = get_buf_frame(&ctx->pbi->common, fb_idx); - if (fb == NULL) return VPX_CODEC_ERROR; - yuvconfig2image(&data->img, fb, NULL); - return VPX_CODEC_OK; + if (ctx->pbi) { + const int fb_idx = ctx->pbi->common.cur_show_frame_fb_idx; + YV12_BUFFER_CONFIG *fb = get_buf_frame(&ctx->pbi->common, fb_idx); + if (fb == NULL) return VPX_CODEC_ERROR; + yuvconfig2image(&data->img, fb, NULL); + return VPX_CODEC_OK; + } else { + return VPX_CODEC_ERROR; + } } else { return VPX_CODEC_INVALID_PARAM; } |