aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-05-19 18:49:24 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-05-19 21:19:00 +0200
commit699201ac0ef64baee261bc6fc587d00724f195af (patch)
tree6f3899efb484c39b412bc93d986bf4a8aa5580b4
parent4b38df82c25cac0234eeb5e6d7844370262d1d7a (diff)
downloadffmpeg-699201ac0ef64baee261bc6fc587d00724f195af.tar.gz
avcodec/options-test: Check avcodec_open2() return value
Fixes: CID1361937 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/options-test.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/options-test.c b/libavcodec/options-test.c
index 2a085795d0..0b064e64d4 100644
--- a/libavcodec/options-test.c
+++ b/libavcodec/options-test.c
@@ -152,8 +152,13 @@ static void test_copy(const AVCodec *c1, const AVCodec *c2)
test_copy_print_codec(ctx1);
test_copy_print_codec(ctx2);
if (ctx1->codec) {
+ int ret;
printf("opened:\n");
- avcodec_open2(ctx1, ctx1->codec, NULL);
+ ret = avcodec_open2(ctx1, ctx1->codec, NULL);
+ if (ret < 0) {
+ fprintf(stderr, "avcodec_open2 failed\n");
+ exit(1);
+ }
if (ctx2->codec && ctx2->codec->priv_class && ctx2->codec->priv_data_size) {
av_opt_set(ctx2->priv_data, "num", "667", 0);
av_opt_set(ctx2->priv_data, "str", "i'm dest value before copy", 0);