comparison stream/freesdp/parser.c @ 28884:304ee75ca7ae

The first valid index is total count - 1 (usually 0)
author ben
date Mon, 09 Mar 2009 20:30:24 +0000
parents 0c7a9144e5f0
children 0f1b5b68af32
comparison
equal deleted inserted replaced
28883:c3f295ceae51 28884:304ee75ca7ae
1642 1642
1643 const char * 1643 const char *
1644 fsdp_get_media_format (const fsdp_media_description_t * dsc, 1644 fsdp_get_media_format (const fsdp_media_description_t * dsc,
1645 unsigned int index) 1645 unsigned int index)
1646 { 1646 {
1647 if (!dsc || (index < dsc->formats_count)) 1647 if (!dsc || (index < dsc->formats_count - 1))
1648 return NULL; 1648 return NULL;
1649 return dsc->formats[index]; 1649 return dsc->formats[index];
1650 } 1650 }
1651 1651
1652 const char * 1652 const char *