Originally committed as revision 17067 to svn://svn.ffmpeg.org/ffmpeg/trunk
Stefano Sabatini authored on 2009/02/09 06:08:42... | ... |
@@ -42,7 +42,7 @@ static const uint8_t map2[] = |
42 | 42 |
0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33 |
43 | 43 |
}; |
44 | 44 |
|
45 |
-int av_base64_decode(uint8_t * out, const char *in, int out_length) |
|
45 |
+int av_base64_decode(uint8_t * out, const char *in, int out_size) |
|
46 | 46 |
{ |
47 | 47 |
int i, v; |
48 | 48 |
uint8_t *dst = out; |
... | ... |
@@ -54,7 +54,7 @@ int av_base64_decode(uint8_t * out, const char *in, int out_length) |
54 | 54 |
return -1; |
55 | 55 |
v = (v << 6) + map2[index]; |
56 | 56 |
if (i & 3) { |
57 |
- if (dst - out < out_length) { |
|
57 |
+ if (dst - out < out_size) { |
|
58 | 58 |
*dst++ = v >> (6 - 2 * (i & 3)); |
59 | 59 |
} |
60 | 60 |
} |
... | ... |
@@ -69,17 +69,17 @@ int av_base64_decode(uint8_t * out, const char *in, int out_length) |
69 | 69 |
* Fixed edge cases and made it work from data (vs. strings) by Ryan. |
70 | 70 |
*****************************************************************************/ |
71 | 71 |
|
72 |
-char *av_base64_encode(char * buf, int buf_len, const uint8_t * src, int len) |
|
72 |
+char *av_base64_encode(char * buf, int buf_size, const uint8_t * src, int size) |
|
73 | 73 |
{ |
74 | 74 |
static const char b64[] = |
75 | 75 |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
76 | 76 |
char *ret, *dst; |
77 | 77 |
unsigned i_bits = 0; |
78 | 78 |
int i_shift = 0; |
79 |
- int bytes_remaining = len; |
|
79 |
+ int bytes_remaining = size; |
|
80 | 80 |
|
81 |
- if (len >= UINT_MAX / 4 || |
|
82 |
- buf_len < (len+2) / 3 * 4 + 1) |
|
81 |
+ if (size >= UINT_MAX / 4 || |
|
82 |
+ buf_size < (size+2) / 3 * 4 + 1) |
|
83 | 83 |
return NULL; |
84 | 84 |
ret = dst = buf; |
85 | 85 |
while (bytes_remaining) { |
... | ... |
@@ -27,13 +27,13 @@ |
27 | 27 |
* Decodes Base64. |
28 | 28 |
* Parameter order is the same as strncpy(). |
29 | 29 |
*/ |
30 |
-int av_base64_decode(uint8_t * out, const char *in, int out_length); |
|
30 |
+int av_base64_decode(uint8_t * out, const char *in, int out_size); |
|
31 | 31 |
|
32 | 32 |
/** |
33 | 33 |
* Encodes Base64. |
34 | 34 |
* @param src data, not a string |
35 | 35 |
* @param buf output string |
36 | 36 |
*/ |
37 |
-char *av_base64_encode(char * buf, int buf_len, const uint8_t * src, int len); |
|
37 |
+char *av_base64_encode(char * buf, int buf_size, const uint8_t * src, int size); |
|
38 | 38 |
|
39 | 39 |
#endif /* AVUTIL_BASE64_H */ |