summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authord s <avxsynth-testing@gmail.com>2013-03-26 19:36:18 -0700
committerMichael Niedermayer <michaelni@gmx.at>2013-03-27 03:47:49 +0100
commit444001bda6adbabf458823b92a9b2a4991457d8d (patch)
treebbb83fd54a11d507aea5ce8cdf3b1126c3306678 /libavformat
parent92a9a3020d2c8276de15d8dd5b8d8787e15bb146 (diff)
Fix avisynth_context_create constructor error handling.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avisynth.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index d31031dd15..3119a45204 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -164,26 +164,22 @@ static av_cold int avisynth_context_create(AVFormatContext *s) {
return ret;
}
- if (!avs)
- return AVERROR_UNKNOWN;
-
- if (!avs_ctx_list) {
- avs_ctx_list = avs;
- } else {
- avs->next = avs_ctx_list;
- avs_ctx_list = avs;
- }
-
avs->env = avs_library->avs_create_script_environment(3);
if (avs_library->avs_get_error) {
const char *error = avs_library->avs_get_error(avs->env);
if (error) {
av_log(s, AV_LOG_ERROR, "%s\n", error);
- av_free(avs);
return AVERROR_UNKNOWN;
}
}
+ if (!avs_ctx_list) {
+ avs_ctx_list = avs;
+ } else {
+ avs->next = avs_ctx_list;
+ avs_ctx_list = avs;
+ }
+
return 0;
}