codecparsers: av1: Fix a error report for metadata obu.

The metadata OBUs, for example, ITUT_T35 has an undefined payload such
as itu_t_t35_payload_bytes field in AV1 spec, which may cause the failure
of parsing the trailings bits. We can give a warning and ignore this kind
of errors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
This commit is contained in:
He Junyan 2020-08-14 14:40:49 +08:00 committed by Víctor Manuel Jáquez Leal
parent 2c3a33eeab
commit f20798a1db

View file

@ -1414,7 +1414,7 @@ gst_av1_parse_metadata_itut_t35 (GstAV1Parser * parser, GstBitReader * br,
if (ret != GST_AV1_PARSER_OK) if (ret != GST_AV1_PARSER_OK)
return ret; return ret;
if (itut_t35->itu_t_t35_country_code) { if (itut_t35->itu_t_t35_country_code == 0xFF) {
itut_t35->itu_t_t35_country_code_extention_byte = itut_t35->itu_t_t35_country_code_extention_byte =
AV1_READ_BITS_CHECKED (br, 8, &ret); AV1_READ_BITS_CHECKED (br, 8, &ret);
if (ret != GST_AV1_PARSER_OK) if (ret != GST_AV1_PARSER_OK)
@ -1689,6 +1689,12 @@ gst_av1_parser_parse_metadata_obu (GstAV1Parser * parser, GstAV1OBU * obu,
goto error; goto error;
retval = av1_skip_trailing_bits (parser, &bit_reader, obu); retval = av1_skip_trailing_bits (parser, &bit_reader, obu);
if (retval != GST_AV1_PARSER_OK) {
GST_WARNING ("Metadata type %d may have wrong trailings.",
metadata->metadata_type);
retval = GST_AV1_PARSER_OK;
}
return retval; return retval;
error: error: