diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2013-04-09 21:31:24 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2013-04-09 21:37:24 -0400 |
commit | 4b89870a5865f59e6dc504dd51c996557ce02657 (patch) | |
tree | ba4d8f9d8b046de88232457b3de7a796dedbd5d6 /ext/srtp/gstsrtp.c | |
parent | 329c250a415af53cb891af72b91fd4d7b8c6f0c5 (diff) | |
download | gstreamer-plugins-bad-4b89870a5865f59e6dc504dd51c996557ce02657.tar.gz |
srtpdec: Don't crash on invalid cipher
Diffstat (limited to 'ext/srtp/gstsrtp.c')
-rw-r--r-- | ext/srtp/gstsrtp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/srtp/gstsrtp.c b/ext/srtp/gstsrtp.c index 30f765c94..c108de2cc 100644 --- a/ext/srtp/gstsrtp.c +++ b/ext/srtp/gstsrtp.c @@ -96,6 +96,8 @@ enum_nick_from_value (GType enum_gtype, gint value) return NULL; enum_value = g_enum_get_value (enum_class, value); + if (!enum_value) + return NULL; nick = enum_value->value_nick; g_type_class_unref (enum_class); @@ -111,9 +113,11 @@ enum_value_from_nick (GType enum_gtype, const gchar * nick) gint value; if (!enum_gtype) - return 0; + return -1; enum_value = g_enum_get_value_by_nick (enum_class, nick); + if (!enum_value) + return -1; value = enum_value->value; g_type_class_unref (enum_class); |