| 895 | } |
| 896 | |
| 897 | static int utf8_check(const uint8_t *str) |
| 898 | { |
| 899 | const uint8_t *byte; |
| 900 | uint32_t codepoint, min; |
| 901 | |
| 902 | while (*str) { |
| 903 | byte = str; |
| 904 | GET_UTF8(codepoint, *(byte++), return 0;); |
| 905 | min = byte - str == 1 ? 0 : byte - str == 2 ? 0x80 : |
| 906 | 1 << (5 * (byte - str) - 4); |
| 907 | if (codepoint < min || codepoint >= 0x110000 || |
| 908 | codepoint == 0xFFFE /* BOM */ || |
| 909 | codepoint >= 0xD800 && codepoint <= 0xDFFF /* surrogates */) |
| 910 | return 0; |
| 911 | str = byte; |
| 912 | } |
| 913 | return 1; |
| 914 | } |
| 915 | |
| 916 | int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, |
| 917 | int *got_sub_ptr, const AVPacket *avpkt) |
no outgoing calls
no test coverage detected