mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
vaapi: h265dec: avoid possible NULL deref
Check "pi" before attempting to dereference it. Captured by static analysis. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2801>
This commit is contained in:
parent
d11a0d04ec
commit
76cc5f88c5
1 changed files with 7 additions and 4 deletions
|
@ -587,8 +587,10 @@ ensure_pps (GstVaapiDecoderH265 * decoder, GstH265PPS * pps)
|
|||
gst_vaapi_parser_info_h265_replace (&priv->active_pps, pi);
|
||||
|
||||
/* Ensure our copy is up-to-date */
|
||||
if (pi) {
|
||||
pi->data.pps = *pps;
|
||||
pi->data.pps.sps = NULL;
|
||||
}
|
||||
|
||||
return pi ? &pi->data.pps : NULL;
|
||||
}
|
||||
|
@ -615,6 +617,7 @@ ensure_sps (GstVaapiDecoderH265 * decoder, GstH265SPS * sps)
|
|||
pi->state |= (priv->active_sps->state & GST_H265_VIDEO_STATE_GOT_I_FRAME);
|
||||
|
||||
/* Ensure our copy is up-to-date */
|
||||
if (pi)
|
||||
pi->data.sps = *sps;
|
||||
|
||||
gst_vaapi_parser_info_h265_replace (&priv->active_sps, pi);
|
||||
|
|
Loading…
Reference in a new issue