Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-10-16 02:36:22 +0300
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-10-18 22:17:58 +0300
commit07d4fe3a871f3ea2f3e475bc84c3e85102ec75ba (patch)
tree331d7f2f5ecbf93ab6818a736bca9b28ff0ba96d /libavutil/rc4.c
parent94f7c97e05737c2856bb08e2172b012a56568bdc (diff)
avutil: use EINVAL instead of -1 for the return code of crypto related init functions
These functions return an error typically when the key size is an incorrect number. AVERROR(EINVAL) is more specific than -1. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavutil/rc4.c')
-rw-r--r--libavutil/rc4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/rc4.c b/libavutil/rc4.c
index 6bd702c495..ffcb112142 100644
--- a/libavutil/rc4.c
+++ b/libavutil/rc4.c
@@ -36,7 +36,7 @@ int av_rc4_init(AVRC4 *r, const uint8_t *key, int key_bits, int decrypt) {
uint8_t *state = r->state;
int keylen = key_bits >> 3;
if (key_bits & 7)
- return -1;
+ return AVERROR(EINVAL);
for (i = 0; i < 256; i++)
state[i] = i;
y = 0;