New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault in rtsp.c when using WRITEDATA #1880
Comments
The following code appears to fix it but I'm not 100% sure if that's correct. In particular I'm not really sure where the RTP output code is set up.
|
I did my change like that since I was convinced that But still the code does make this decision, so the question is then who's right. The code or the (lack of) docs saying it should work like that. I think I'm inclined to rule against the code here and in favor of the documentation. So yes, let's pass the data to the regular callback + writedata unless the curl_write_callback writeit;
void *user_ptr;
if(len == 0) {
failf(data, "Cannot write a 0 size RTP packet.");
return CURLE_WRITE_ERROR;
}
if(data->set.fwrite_rtp) {
writeit = data->set.fwrite_rtp;
user_ptr = data->set.rtp_out;
}
else
{
writeit = data->set.fwrite_func;
user_ptr = data->set.out;
}
wrote = writeit(ptr, 1, len, user_ptr);
Can you perhaps amend this by also making some clarification in the documentation? |
After the fix to rtsp.c in a14f715, I've tried to run a test where I set WRITEDATA and WRITEFUNCTION and rtsp.c is still failing. I think the issue is as below:
It doesn't suffice to simply use
data->set.rtp_out
- I think the userdata pointer has to be set up by theif
statement as well. I think if the fwrite_func is being used then thedata->set.out
pointer should be passed to the callback instead ofdata->set.rtp_out
.The text was updated successfully, but these errors were encountered: