diff options
author | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-10-15 19:36:22 -0400 |
---|---|---|
committer | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-10-18 15:17:58 -0400 |
commit | 07d4fe3a871f3ea2f3e475bc84c3e85102ec75ba (patch) | |
tree | 331d7f2f5ecbf93ab6818a736bca9b28ff0ba96d /libavutil/des.c | |
parent | 94f7c97e05737c2856bb08e2172b012a56568bdc (diff) | |
download | ffmpeg-07d4fe3a871f3ea2f3e475bc84c3e85102ec75ba.tar.gz |
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/des.c')
-rw-r--r-- | libavutil/des.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/des.c b/libavutil/des.c index c97158a76d..3ccbf89dbb 100644 --- a/libavutil/des.c +++ b/libavutil/des.c @@ -292,7 +292,7 @@ AVDES *av_des_alloc(void) int av_des_init(AVDES *d, const uint8_t *key, int key_bits, av_unused int decrypt) { if (key_bits != 64 && key_bits != 192) - return -1; + return AVERROR(EINVAL); d->triple_des = key_bits > 64; gen_roundkeys(d->round_keys[0], AV_RB64(key)); if (d->triple_des) { |