diff options
author | d s <avxsynth-testing@gmail.com> | 2013-03-26 19:36:18 -0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-27 03:47:49 +0100 |
commit | 444001bda6adbabf458823b92a9b2a4991457d8d (patch) | |
tree | bbb83fd54a11d507aea5ce8cdf3b1126c3306678 | |
parent | 92a9a3020d2c8276de15d8dd5b8d8787e15bb146 (diff) | |
download | ffmpeg-444001bda6adbabf458823b92a9b2a4991457d8d.tar.gz |
Fix avisynth_context_create constructor error handling.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/avisynth.c | 18 |
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; } |