g_return_val_if_fail (msg != NULL, GST_WFD_EINVAL);
if (msg->content_protection && msg->content_protection->hdcp2_spec) {
char *result = NULL;
- char *ptr[2] = {0, };
+ char *ptr = NULL;
if (!g_strcmp0 (msg->content_protection->hdcp2_spec->hdcpversion, "none")) {
*hdcpversion = GST_WFD_HDCP_NONE;
*TCPPort = 0;
}
if (msg->content_protection->hdcp2_spec->TCPPort) {
- result = strtok_r (msg->content_protection->hdcp2_spec->TCPPort, "=", &ptr[0]);
- while (result != NULL) {
- result = strtok_r (NULL, "=", &ptr[1]);
+ result = strtok_r (msg->content_protection->hdcp2_spec->TCPPort, "=", &ptr);
+ while (result != NULL && ptr != NULL) {
+ result = strtok_r (NULL, "=", &ptr);
*TCPPort = atoi (result);
break;
}