static void vavs2_vf_put(struct vframe_s *vf, void *op_arg)
{
struct AVS2Decoder_s *dec = (struct AVS2Decoder_s *)op_arg;
- uint8_t index = vf->index & 0xff;
+ uint8_t index;
if (vf == (&dec->vframe_dummy))
return;
+ if (!vf)
+ return;
+
+ index = vf->index & 0xff;
+
kfifo_put(&dec->newframe_q, (const struct vframe_s *)vf);
dec->vf_put_count++;
avs2_print(dec, AVS2_DBG_BUFMGR,
if (vf == (&hw->vframe_dummy))
return;
+
+ if (!vf)
+ return;
+
if (vf->index == -1) {
dpb_print(DECODE_ID(hw), 0,
"Warning: %s vf %p invalid index\r\n",
{
struct vdec_s *vdec = op_arg;
struct vdec_mjpeg_hw_s *hw = (struct vdec_mjpeg_hw_s *)vdec->private;
+
+ if (!vf)
+ return;
+
mmjpeg_debug_print(DECODE_ID(hw), PRINT_FRAME_NUM,
"%s:put_num:%d\n", __func__, hw->put_num);
hw->vfbuf_use[vf->index]--;
struct vdec_s *vdec = op_arg;
struct vdec_mpeg4_hw_s *hw = (struct vdec_mpeg4_hw_s *)vdec->private;
+ if (!vf)
+ return;
+
hw->vfbuf_use[vf->index]--;
hw->put_num++;
mmpeg4_debug_print(DECODE_ID(hw), PRINT_FRAME_NUM,
static void vvp9_vf_put(struct vframe_s *vf, void *op_arg)
{
struct VP9Decoder_s *pbi = (struct VP9Decoder_s *)op_arg;
- uint8_t index = vf->index & 0xff;
+ uint8_t index;
if (vf == (&pbi->vframe_dummy))
return;
+ if (!vf)
+ return;
+
+ index = vf->index & 0xff;
+
if (pbi->enable_fence && vf->fence) {
vdec_fence_put(vf->fence);
vf->fence = NULL;