projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfcbe8c
)
opt: check the return values of av_get_token for ENOMEM.
author
Anton Khirnov
<anton@khirnov.net>
Mon, 25 Feb 2013 11:32:49 +0000
(12:32 +0100)
committer
Anton Khirnov
<anton@khirnov.net>
Thu, 4 Apr 2013 05:51:53 +0000
(07:51 +0200)
libavutil/opt.c
patch
|
blob
|
history
diff --git
a/libavutil/opt.c
b/libavutil/opt.c
index
2cc6f6c
..
f2b9473
100644
(file)
--- a/
libavutil/opt.c
+++ b/
libavutil/opt.c
@@
-562,9
+562,16
@@
static int parse_key_value_pair(void *ctx, const char **buf,
char *val;
int ret;
+ if (!key)
+ return AVERROR(ENOMEM);
+
if (*key && strspn(*buf, key_val_sep)) {
(*buf)++;
val = av_get_token(buf, pairs_sep);
+ if (!val) {
+ av_freep(&key);
+ return AVERROR(ENOMEM);
+ }
} else {
av_log(ctx, AV_LOG_ERROR, "Missing key or no key/value separator found after key '%s'\n", key);
av_free(key);