You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
Fix avisynth_context_create constructor error handling.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -164,8 +164,14 @@ static av_cold int avisynth_context_create(AVFormatContext *s) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!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);
|
||||||
return AVERROR_UNKNOWN;
|
return AVERROR_UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!avs_ctx_list) {
|
if (!avs_ctx_list) {
|
||||||
avs_ctx_list = avs;
|
avs_ctx_list = avs;
|
||||||
@@ -174,16 +180,6 @@ static av_cold int avisynth_context_create(AVFormatContext *s) {
|
|||||||
avs_ctx_list = avs;
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user