aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/extract_mvs.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-15 08:27:45 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-06-08 12:52:50 +0200
commit3a5412b39eeb2f7af66acc985b55ccdb8bb9a953 (patch)
tree06b31f3b5af83e6da1134eac5cdd9fb946bc3214 /doc/examples/extract_mvs.c
parent933308a29063f849f7b71be08140f56f9dec1eca (diff)
downloadffmpeg-3a5412b39eeb2f7af66acc985b55ccdb8bb9a953.tar.gz
doc/examples/extract_mvs: Explicitly free options
The user should not rely on all options always being recognized (in particular not on error). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'doc/examples/extract_mvs.c')
-rw-r--r--doc/examples/extract_mvs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c
index 42e1844150..f5d2fd9179 100644
--- a/doc/examples/extract_mvs.c
+++ b/doc/examples/extract_mvs.c
@@ -104,7 +104,9 @@ static int open_codec_context(AVFormatContext *fmt_ctx, enum AVMediaType type)
/* Init the video decoder */
av_dict_set(&opts, "flags2", "+export_mvs", 0);
- if ((ret = avcodec_open2(dec_ctx, dec, &opts)) < 0) {
+ ret = avcodec_open2(dec_ctx, dec, &opts);
+ av_dict_free(&opts);
+ if (ret < 0) {
fprintf(stderr, "Failed to open %s codec\n",
av_get_media_type_string(type));
return ret;