mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
codecparsers: Exclude the size of obu_size when identify OBU.
obu->obu_size does not contain the bytes of obu_size itself, we need to exclude it when doing the saint check. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1614>
This commit is contained in:
parent
3e82c1f88e
commit
b93315fa6c
1 changed files with 5 additions and 1 deletions
|
@ -824,12 +824,16 @@ gst_av1_parser_identify_one_obu (GstAV1Parser * parser, const guint8 * data,
|
||||||
GST_LOG ("identify obu type is %d", obu->obu_type);
|
GST_LOG ("identify obu type is %d", obu->obu_type);
|
||||||
|
|
||||||
if (obu->header.obu_has_size_field) {
|
if (obu->header.obu_has_size_field) {
|
||||||
|
guint size_sz = gst_bit_reader_get_pos (&br) / 8;
|
||||||
|
|
||||||
obu->obu_size = av1_bitstreamfn_leb128 (&br, &ret);
|
obu->obu_size = av1_bitstreamfn_leb128 (&br, &ret);
|
||||||
if (ret != GST_AV1_PARSER_OK)
|
if (ret != GST_AV1_PARSER_OK)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
size_sz = gst_bit_reader_get_pos (&br) / 8 - size_sz;
|
||||||
if (obu_length
|
if (obu_length
|
||||||
&& obu_length - 1 - obu->header.obu_extention_flag != obu->obu_size) {
|
&& obu_length - 1 - obu->header.obu_extention_flag - size_sz !=
|
||||||
|
obu->obu_size) {
|
||||||
/* If obu_size and obu_length are both present, but inconsistent,
|
/* If obu_size and obu_length are both present, but inconsistent,
|
||||||
then the packed bitstream is deemed invalid. */
|
then the packed bitstream is deemed invalid. */
|
||||||
ret = GST_AV1_PARSER_BITSTREAM_ERROR;
|
ret = GST_AV1_PARSER_BITSTREAM_ERROR;
|
||||||
|
|
Loading…
Reference in a new issue