Commit 05f79581 authored by Simon Morlat's avatar Simon Morlat

sanity checks

parent aca5bcf6
......@@ -123,6 +123,14 @@ PayloadType * rtp_profile_get_payload_from_rtpmap(RtpProfile *profile, const cha
}
int rtp_profile_move_payload(RtpProfile *prof,int oldpos,int newpos){
if (oldpos<0 || oldpos>=RTP_PROFILE_MAX_PAYLOADS) {
ortp_error("Bad old pos index %i",oldpos);
return -1;
}
if (newpos<0 || newpos>=RTP_PROFILE_MAX_PAYLOADS) {
ortp_error("Bad new pos index %i",newpos);
return -1;
}
prof->payload[newpos]=prof->payload[oldpos];
prof->payload[oldpos]=NULL;
return 0;
......
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