codecparsers: av1: fix underflow in last_frame_idx

The spec mandates this field be parsed using unsigned arithmetic. Nevertheless,
av1parser will use -1 apparently as an uninitialized value in
gst_av1_parse_frame_header. This immediately underflows last_frame_idx
though, since its type was defined as guint8. Fix this by converting to gint8.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2401>
This commit is contained in:
Daniel Almeida 2021-07-12 09:01:06 -03:00 committed by GStreamer Marge Bot
parent 211f968981
commit d0e614b354

View file

@ -1560,7 +1560,7 @@ struct _GstAV1FrameHeaderOBU {
guint32 ref_order_hint[GST_AV1_NUM_REF_FRAMES]; guint32 ref_order_hint[GST_AV1_NUM_REF_FRAMES];
gboolean allow_intrabc; gboolean allow_intrabc;
gboolean frame_refs_short_signaling; gboolean frame_refs_short_signaling;
guint8 last_frame_idx; gint8 last_frame_idx;
gint8 gold_frame_idx; gint8 gold_frame_idx;
gint8 ref_frame_idx[GST_AV1_REFS_PER_FRAME]; gint8 ref_frame_idx[GST_AV1_REFS_PER_FRAME];
gboolean allow_high_precision_mv; gboolean allow_high_precision_mv;