mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
msdk: Make sure a variable is initialized when it is used
Previously alloc_info is initialized when both thiz->initialized and thiz->allocation_caps are true, but only thiz->initialized is checked when alloc_info is used.
This commit is contained in:
parent
38cf42f90f
commit
1bfd1b2bf9
1 changed files with 9 additions and 8 deletions
|
@ -893,16 +893,17 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thiz->initialized && thiz->allocation_caps)
|
if (!thiz->initialized)
|
||||||
|
hard_reset = TRUE;
|
||||||
|
else if (thiz->allocation_caps) {
|
||||||
gst_video_info_from_caps (&alloc_info, thiz->allocation_caps);
|
gst_video_info_from_caps (&alloc_info, thiz->allocation_caps);
|
||||||
|
|
||||||
/* Check whether we need complete reset for dynamic resolution change */
|
/* Check whether we need complete reset for dynamic resolution change */
|
||||||
if (!thiz->initialized || (thiz->initialized &&
|
if (thiz->param.mfx.FrameInfo.Width > GST_VIDEO_INFO_WIDTH (&alloc_info)
|
||||||
(thiz->param.mfx.FrameInfo.Width >
|
|
||||||
GST_VIDEO_INFO_WIDTH (&alloc_info)
|
|
||||||
|| thiz->param.mfx.FrameInfo.Height >
|
|| thiz->param.mfx.FrameInfo.Height >
|
||||||
GST_VIDEO_INFO_HEIGHT (&alloc_info))))
|
GST_VIDEO_INFO_HEIGHT (&alloc_info))
|
||||||
hard_reset = TRUE;
|
hard_reset = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* if subclass requested for the force reset */
|
/* if subclass requested for the force reset */
|
||||||
if (thiz->force_reset_on_res_change)
|
if (thiz->force_reset_on_res_change)
|
||||||
|
|
Loading…
Reference in a new issue