summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2019-04-05 15:03:35 -0700
committerJames Zern <jzern@google.com>2019-04-05 15:03:35 -0700
commite1a7f8456bedbaef0ce19a08d90fa8bebbdac409 (patch)
tree1cb10ac864efa0cf0e1fb4b0a4024a2dbc1a7021
parent65e5ba89b3c15c2fdbad35808bc91c1838754270 (diff)
downloadlibvpx-e1a7f8456bedbaef0ce19a08d90fa8bebbdac409.tar
libvpx-e1a7f8456bedbaef0ce19a08d90fa8bebbdac409.tar.gz
libvpx-e1a7f8456bedbaef0ce19a08d90fa8bebbdac409.tar.bz2
libvpx-e1a7f8456bedbaef0ce19a08d90fa8bebbdac409.zip
svc_encodeframe: check strdup return
BUG=webm:1616 Change-Id: Ic9de589154485ad2de30b0b044991e1f9b852d74
-rw-r--r--examples/svc_encodeframe.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/svc_encodeframe.c b/examples/svc_encodeframe.c
index d9e66b6e4..a73ee8ed6 100644
--- a/examples/svc_encodeframe.c
+++ b/examples/svc_encodeframe.c
@@ -155,6 +155,7 @@ static vpx_codec_err_t parse_layer_options_from_string(SvcContext *svc_ctx,
return VPX_CODEC_INVALID_PARAM;
input_string = strdup(input);
+ if (input_string == NULL) return VPX_CODEC_MEM_ERROR;
token = strtok_r(input_string, delim, &save_ptr);
for (i = 0; i < num_layers; ++i) {
if (token != NULL) {
@@ -194,6 +195,7 @@ static vpx_codec_err_t parse_options(SvcContext *svc_ctx, const char *options) {
if (options == NULL) return VPX_CODEC_OK;
input_string = strdup(options);
+ if (input_string == NULL) return VPX_CODEC_MEM_ERROR;
// parse option name
option_name = strtok_r(input_string, "=", &input_ptr);