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:
@@ -86,9 +86,9 @@ int main(int argc, char **argv) {
|
||||
res = vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL,
|
||||
VPX_CODEC_USE_POSTPROC);
|
||||
if (res == VPX_CODEC_INCAPABLE)
|
||||
die_codec(&codec, "Postproc not supported by this decoder.");
|
||||
die("Postproc not supported by this decoder.");
|
||||
|
||||
if (res) die_codec(&codec, "Failed to initialize decoder.");
|
||||
if (res) die("Failed to initialize decoder.");
|
||||
|
||||
while (vpx_video_reader_read_frame(reader)) {
|
||||
vpx_codec_iter_t iter = NULL;
|
||||
|
||||
Reference in New Issue
Block a user