OMX_BUFFERHEADERTYPE * pBuffer)
{
GstOMXBuffer *buf = pBuffer->pAppPrivate;
- GstOMXPort *port = buf->port;
- GstOMXComponent *comp = port->comp;
+ GstOMXPort *port;
+ GstOMXComponent *comp;
+
+ if (buf == NULL) {
+ GST_ERROR ("Have unknown or deallocated buffer %p", pBuffer);
+ return OMX_ErrorNone;
+ }
+
+ port = buf->port;
+ comp = port->comp;
g_assert (buf->omx_buf == pBuffer);
OMX_BUFFERHEADERTYPE * pBuffer)
{
GstOMXBuffer *buf = pBuffer->pAppPrivate;
- GstOMXPort *port = buf->port;
- GstOMXComponent *comp = port->comp;
+ GstOMXPort *port;
+ GstOMXComponent *comp;
+
+ if (buf == NULL) {
+ GST_ERROR ("Have unknown or deallocated buffer %p", pBuffer);
+ return OMX_ErrorNone;
+ }
+
+ port = buf->port;
+ comp = port->comp;
g_assert (buf->omx_buf == pBuffer);
*/
if (buf->omx_buf) {
g_assert (buf == buf->omx_buf->pAppPrivate);
+ buf->omx_buf->pAppPrivate = NULL;
tmp = OMX_FreeBuffer (comp->handle, port->index, buf->omx_buf);
if (tmp != OMX_ErrorNone) {
GST_ERROR_OBJECT (comp->parent,