| 191 | } |
| 192 | |
| 193 | static int mcc_parse_time_code_part(char **line_left, unsigned *value, unsigned max, const char *after_set) |
| 194 | { |
| 195 | *value = 0; |
| 196 | if (!av_isdigit(**line_left)) |
| 197 | return AVERROR_INVALIDDATA; |
| 198 | while (av_isdigit(**line_left)) { |
| 199 | unsigned digit = **line_left - '0'; |
| 200 | *value = *value * 10 + digit; |
| 201 | ++*line_left; |
| 202 | if (*value > max) |
| 203 | return AVERROR_INVALIDDATA; |
| 204 | } |
| 205 | unsigned char after = **line_left; |
| 206 | if (!after || !strchr(after_set, after)) |
| 207 | return AVERROR_INVALIDDATA; |
| 208 | ++*line_left; |
| 209 | return after; |
| 210 | } |
| 211 | |
| 212 | static int mcc_parse_time_code(char **line_left, MCCTimecode *tc) |
| 213 | { |
no test coverage detected