| 251 | } |
| 252 | |
| 253 | static bool ReadAMFShortStringBody(std::string* str, AMFInputStream* stream) { |
| 254 | uint16_t len = 0; |
| 255 | if (stream->cut_u16(&len) != 2u) { |
| 256 | LOG(ERROR) << "stream is not long enough"; |
| 257 | return false; |
| 258 | } |
| 259 | str->resize(len); |
| 260 | if (len != 0 && stream->cutn(&(*str)[0], len) != len) { |
| 261 | LOG(ERROR) << "stream is not long enough"; |
| 262 | return false; |
| 263 | } |
| 264 | return true; |
| 265 | } |
| 266 | |
| 267 | static bool ReadAMFLongStringBody(std::string* str, AMFInputStream* stream) { |
| 268 | uint32_t len = 0; |
no test coverage detected