examples: use die() on dec/enc_init() failure

rather than die_codec(). calling any api functions with an uninitialized
codec context is undefined. this avoids a crash in a call to
vpx_codec_error_detail().

BUG=webm:1688

Change-Id: I4a4feeabc1cafa44c8d2f24587fad79e313dba6d
This commit is contained in:
James Zern
2020-05-06 13:01:57 -07:00
parent b130f71bf0
commit cbc276a3d4
10 changed files with 12 additions and 12 deletions

View File

@@ -815,7 +815,7 @@ int main(int argc, char **argv) {
#else
if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
#endif // CONFIG_VP9_HIGHBITDEPTH
die_codec(&codec, "Failed to initialize encoder");
die("Failed to initialize encoder");
if (strncmp(encoder->name, "vp8", 3) == 0) {
vpx_codec_control(&codec, VP8E_SET_CPUUSED, -speed);