From b9ecf3b40da75be0fff4bbaa7391419a1bd7e5b7 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 25 Jul 2018 15:47:49 -0400 Subject: [PATCH] h265decoder: Don't scan empty buffer Same as what we did for H264 decoder, this is to avoid an assertion in the adapter. https://bugzilla.gnome.org/show_bug.cgi?id=796832 --- gst-libs/gst/vaapi/gstvaapidecoder_h265.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index e9353cf40b..156237bb90 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -2572,6 +2572,9 @@ decode_slice (GstVaapiDecoderH265 * decoder, GstVaapiDecoderUnit * unit) static inline gint scan_for_start_code (GstAdapter * adapter, guint ofs, guint size, guint32 * scp) { + if (size == 0) + return -1; + return (gint) gst_adapter_masked_scan_uint32_peek (adapter, 0xffffff00, 0x00000100, ofs, size, scp); }