diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-02-06 15:54:09 +0100 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-02-06 15:54:42 +0100 |
commit | d75d70d395d48eb02ef31b5656131b85c8221a97 (patch) | |
tree | 99f0e7647eae1dcf2f2fbded60581962ac99aae5 /gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c | |
parent | d46e8d9961b9dbc12d77b087af80d3fba733b4f9 (diff) |
mpeg2: fix crash when there is no free surface to decode into.
Diffstat (limited to 'gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c')
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c index 3e6c5aa1..a702b96f 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c @@ -685,6 +685,10 @@ decode_buffer(GstVaapiDecoderMpeg2 *decoder, GstBuffer *buffer) gst_adapter_flush(priv->adapter, ofs); size -= ofs; + status = gst_vaapi_decoder_check_status(decoder); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + break; + if (size < 8) break; ofs = scan_for_start_code(priv->adapter, 4, size - 4, NULL); |