mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
opt: check the return values of av_get_token for ENOMEM.
This commit is contained in:
parent
dfcbe8cbd7
commit
bcc9432898
1 changed files with 7 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue