Pulse-Eight / libcec

USB CEC Adapter communication Library http://libcec.pulse-eight.com/
Other
721 stars 290 forks source link

Null function pointer call in OnTVServiceCallback #184

Open popcornmix opened 8 years ago

popcornmix commented 8 years ago

This backtrace showed up in this forum post.

Presumably:

m_callback->HandlePhysicalAddressChanged(iNewAddress);

was called with m_callback->HandlePhysicalAddressChanged being NULL. I assume a:

if (m_callback && m_callback->HandlePhysicalAddressChanged)
  m_callback->HandlePhysicalAddressChanged(iNewAddress);

would be the simple way of avoiding the crash, but there may be a better solution.

opdenkamp commented 8 years ago

Looks like CEC::CCECClient::Process didn't get stopped correctly there too, both threads 13 and 15 are blocked in it.

What I think is happening is that it's not hitting this line for some reason https://github.com/Pulse-Eight/libcec/blob/master/src/libcec/adapter/RPi/RPiCECAdapterCommunication.cpp#L357 which should unregister the callback. The only way for m_callback to become NULL is when the connection gets closed.

I'll have to take another look at this one