Commit d6bdd063 authored by Jean-Paul Saman's avatar Jean-Paul Saman

src/dvbpsi.c: assert() on correct condition

The assert fired on the p_dvbpsi->p_private being NULL, while it should
have reacted on p_dvbpsi->p_private not being NULL. When the handle to
libdvbpsi (holding msg callback) is being deleted NO decoder maybe attached.
parent afa7ad7e
...@@ -161,7 +161,7 @@ dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb callback, enum dvbpsi_msg_level lev ...@@ -161,7 +161,7 @@ dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb callback, enum dvbpsi_msg_level lev
*****************************************************************************/ *****************************************************************************/
void dvbpsi_DeleteHandle(dvbpsi_t *handle) void dvbpsi_DeleteHandle(dvbpsi_t *handle)
{ {
assert(handle->p_private != NULL); assert(handle->p_private == NULL);
handle->pf_message = NULL; handle->pf_message = NULL;
free(handle); free(handle);
} }
......
...@@ -102,7 +102,7 @@ void dvbpsi_DetachPAT(dvbpsi_t *p_dvbpsi) ...@@ -102,7 +102,7 @@ void dvbpsi_DetachPAT(dvbpsi_t *p_dvbpsi)
if (p_pat_decoder->p_current_section) if (p_pat_decoder->p_current_section)
dvbpsi_DeletePSISections(p_pat_decoder->p_current_section); dvbpsi_DeletePSISections(p_pat_decoder->p_current_section);
free(p_pat_decoder); free(p_pat_decoder);
p_dvbpsi->p_private = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment