diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2020-05-07 11:06:45 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2020-05-07 12:08:36 -0400 |
commit | 269ab891c574263cb5fdf48de8e396b8418be1f4 (patch) | |
tree | 102d9cd345de4555a61a0df8d616cf5933a64e1d /gst/videoparsers | |
parent | 3784bd4a739fe08d591f8374bafb968b605196f3 (diff) | |
download | gstreamer-plugins-bad-269ab891c574263cb5fdf48de8e396b8418be1f4.tar.gz |
h264/h265parse: Fix initial skip
Account for start codes possibly be 4 bytes. For HEVC, also take into
account that we might be missing only one of the two identification
bytes.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
Diffstat (limited to 'gst/videoparsers')
-rw-r--r-- | gst/videoparsers/gsth264parse.c | 3 | ||||
-rw-r--r-- | gst/videoparsers/gsth265parse.c | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 8f1215196..83c985393 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -1384,7 +1384,8 @@ gst_h264_parse_handle_frame (GstBaseParse * parse, } break; case GST_H264_PARSER_NO_NAL: - *skipsize = size - 3; + /* Start code may have up to 4 bytes */ + *skipsize = size - 4; goto skip; break; default: diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c index 0c4ca177b..849e74363 100644 --- a/gst/videoparsers/gsth265parse.c +++ b/gst/videoparsers/gsth265parse.c @@ -1208,7 +1208,10 @@ gst_h265_parse_handle_frame (GstBaseParse * parse, } break; case GST_H265_PARSER_NO_NAL: - *skipsize = size - 3; + /* start code may have up to 4 bytes, and we may also get that return + * value if only one of the two header bytes are present, make sure + * not to skip too much */ + *skipsize = size - 5; goto skip; default: /* should not really occur either */ |