dvb/camsession: Don't do operations on unexisting sessions

CID #206114
This commit is contained in:
Edward Hervey 2014-04-16 15:37:57 +02:00
parent 1a42aaad47
commit d16cc860a3

View file

@ -451,15 +451,16 @@ handle_close_session_request (CamSL * sl, CamTLConnection * connection,
session = g_hash_table_lookup (sl->sessions, session = g_hash_table_lookup (sl->sessions,
GINT_TO_POINTER ((guint) session_nb)); GINT_TO_POINTER ((guint) session_nb));
if (session == NULL) { if (session == NULL) {
GST_WARNING ("got CLOSE_SESSION_REQUEST for unknown session: %d", GST_WARNING ("got CLOSE_SESSION_REQUEST for unknown session: %d",
session_nb); session_nb);
return CAM_RETURN_OK;
}
status = 0xF0; if (session->state == CAM_SL_SESSION_STATE_CLOSING) {
} else if (session->state == CAM_SL_SESSION_STATE_CLOSING) {
GST_WARNING ("got CLOSE_SESSION_REQUEST for closing session: %d", GST_WARNING ("got CLOSE_SESSION_REQUEST for closing session: %d",
session_nb); session_nb);
status = 0xF0; status = 0xF0;
} }