vaapiencode: don't crash on NULL encoder on _finish().
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 13 Jan 2014 16:18:42 +0000 (17:18 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 13 Jan 2014 16:31:55 +0000 (17:31 +0100)
commit2c4fde0eae02383a9780e8e87ce1e3d442bf80ce
tree7d2c81f92f97afe7dd2bbce46372759c6e978f03
parentea7c1d87c5e578adf6e1ac24fe136f453134049d
vaapiencode: don't crash on NULL encoder on _finish().

Don't try to destroy an encoder, in GstVideoEncoder::finish() handler,
if it was not created in the first place. Return "not-negotiated" error
since this means we did not even reach GstVideoEncoder::set_format(),
where the encoder could have been created.

This fixes a crash when the vaapiencode_* plug-in elements get deallocated
and that we failed to negotiate either pad.

https://bugzilla.gnome.org/show_bug.cgi?id=719704
gst/vaapi/gstvaapiencode.c