X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=wma_common.c;h=c4d96ad0f62c396cac54e3fcdabca87974f241d6;hb=620c2a3eb4c3395c5be73f663435740ecd878775;hp=9a7a22acf30bd310f2dd14f8494f93cff5adc070;hpb=3de351a14c800d2bc7e94f85d73dfd5ac5080572;p=paraslash.git diff --git a/wma_common.c b/wma_common.c index 9a7a22ac..c4d96ad0 100644 --- a/wma_common.c +++ b/wma_common.c @@ -46,10 +46,8 @@ static int find_audio_stream_info(const char *buf, int len) const char pattern[] = {0x40, 0x9e, 0x69, 0xf8}; const char *p = search_pattern(pattern, sizeof(pattern), buf, len); - if (!p) { - PARA_NOTICE_LOG("audio stream guid not found"); - return -1; - } + if (!p) + return -E_WMA_NO_GUID; PARA_DEBUG_LOG("found audio stream guid@%0zx\n", p - buf); return p - buf; } @@ -58,11 +56,9 @@ static int read_header_len(char *buf, int len) { uint16_t header_len; - if (len < 18) - return -1; header_len = read_u16(buf + 16) + 46; if (header_len > len) - return -2; + return -E_WMA_BAD_ASF_HEADER; PARA_DEBUG_LOG("header_len: %d\n", header_len); return header_len; }