shithub: libvpx

Download patch

ref: e9499074d38cca489764a85ae0f795a0c39c8a44
parent: 1545bbcccb1b42b77fe9cf97054d1f3abf4f2d3e
parent: e1a7f8456bedbaef0ce19a08d90fa8bebbdac409
author: James Zern <jzern@google.com>
date: Fri Apr 5 20:32:11 EDT 2019

Merge "svc_encodeframe: check strdup return"

--- a/examples/svc_encodeframe.c
+++ b/examples/svc_encodeframe.c
@@ -155,6 +155,7 @@
     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 @@
 
   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);