From 3b9a165037b2cef868087d6cd963886072241d52 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Wed, 12 Oct 2011 14:00:50 +0200 Subject: [PATCH] decoder: fix use of invalid data at the end-of-stream. --- NEWS | 1 + gst-libs/gst/vaapi/gstvaapidecoder.c | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 2997fe77df..871f5097a0 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ Version 0.2.7 - DD.Jul.2011 * Fix MPEG-2 decoding from TS & PS streams * Fix build with newer versions of FFmpeg * Fix vaapiconvert direct-rendering modes +* Fix use of invalid data at the end-of-stream Version 0.2.6 - 14.Jun.2011 * Fix licensing terms (LGPL v2.1) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.c b/gst-libs/gst/vaapi/gstvaapidecoder.c index 2f0274b96a..c6282b7f77 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder.c @@ -117,12 +117,9 @@ decode_step(GstVaapiDecoder *decoder) status = GST_VAAPI_DECODER_GET_CLASS(decoder)->decode(decoder, buffer); GST_DEBUG("decode frame (status = %d)", status); + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS && GST_BUFFER_IS_EOS(buffer)) + status = GST_VAAPI_DECODER_STATUS_END_OF_STREAM; gst_buffer_unref(buffer); - if (status == GST_VAAPI_DECODER_STATUS_SUCCESS) - return status; - - if (GST_BUFFER_IS_EOS(buffer)) - return GST_VAAPI_DECODER_STATUS_END_OF_STREAM; } while (status == GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA); return status; }