summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder.c7
2 files changed, 3 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 2997fe7..871f509 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 2f0274b..c6282b7 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;
}