decoder: AV1: Fix a static analysis problem of update_state().

No need to check the picture pointer after we have already dereferenced it.

Fix: #298
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/408>
This commit is contained in:
He Junyan 2021-01-09 16:05:48 +08:00
parent 5523b75550
commit 5e3fde8569

View file

@ -978,13 +978,8 @@ av1_decoder_update_state (GstVaapiDecoderAV1 * decoder,
for (i = 0; i < GST_AV1_NUM_REF_FRAMES; i++) {
if ((picture->frame_header.refresh_frame_flags >> i) & 1) {
if (picture) {
GST_LOG ("reference frame %p to ref slot:%d", picture, i);
gst_vaapi_picture_replace (&priv->ref_frames[i], picture);
} else {
GST_ERROR ("we miss some reference frame for ref slot:%d", i);
gst_vaapi_picture_replace (&priv->ref_frames[i], NULL);
}
GST_LOG ("reference frame %p to ref slot:%d", picture, i);
gst_vaapi_picture_replace (&priv->ref_frames[i], picture);
}
}