Fix corruption via buffer overflow in mediaserver

change unbound sprintf() to snprintf() so network-provided values
can't overflow the buffers.

Applicable to all K/L/M/N branches.

Bug: 25747670
Change-Id: Id6a5120c2d08a6fbbd47deffb680ecf82015f4f6

bool ASessionDescription::getDurationUs(int64_t *durationUs) const {
 *durationUs = 0;

    CHECK(mIsValid);

 AString value;
 if (!findAttribute(0, "a=range", &value)) {
 return false;
 }

 if (strncmp(value.c_str(), "npt=", 4)) {
 return false;
 }

 float from, to;
 if (!parseNTPRange(value.c_str() + 4, &from, &to)) {
 return false;
 }

 *durationUs = (int64_t)((to - from) * 1E6);

 return true;
}

bool ASessionDescription::getDurationUs(int64_t *durationUs) const {
 *durationUs = 0;

    CHECK(mIsValid);

 AString value;
 if (!findAttribute(0, "a=range", &value)) {
 return false;
 }

 if (strncmp(value.c_str(), "npt=", 4)) {
 return false;
 }

 float from, to;
 if (!parseNTPRange(value.c_str() + 4, &from, &to)) {
 return false;
 }

 *durationUs = (int64_t)((to - from) * 1E6);

 return true;
}
