decoder: fix use of invalid data at the end-of-stream.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 12 Oct 2011 12:00:50 +0000 (14:00 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 19 Oct 2011 15:33:36 +0000 (17:33 +0200)
NEWS
gst-libs/gst/vaapi/gstvaapidecoder.c

diff --git a/NEWS b/NEWS
index 2997fe7..871f509 100644 (file)
--- 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)
index 2f0274b..c6282b7 100644 (file)
@@ -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;
 }