diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2016-02-19 19:03:44 -0300 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2016-02-22 12:09:35 +0100 |
commit | 1f71503fc9701ad7b5ed7884d4d585146baaf4e0 (patch) | |
tree | 6195cd86327b4029c9ac3aa5528dd5a30501c9f6 | |
parent | 056a69cf2a730a387a51c0aa5c3089198006bade (diff) |
vaapidecoder_h265: fix parsing of NALU aligned data
Don't assume the whole buffer is a single NAL, instead look for the
next start code in case there are multiple NALs per buffer.
https://bugzilla.gnome.org/show_bug.cgi?id=762328
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_h265.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index 6170b6a5..aec4bb8d 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -2779,9 +2779,12 @@ gst_vaapi_decoder_h265_parse (GstVaapiDecoder * base_decoder, } else { if (size < 4) return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; - if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H265_NALU) + if (priv->stream_alignment == GST_VAAPI_STREAM_ALIGN_H265_NALU) { buf_size = size; - else { + ofs = scan_for_start_code (adapter, 4, size - 4, NULL); + if (ofs > 0) + buf_size = ofs; + } else { ofs = scan_for_start_code (adapter, 0, size, NULL); if (ofs < 0) return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; |