On 7/28/24 9:38 AM, Ramiro Polla wrote:
@@ -1134,6 +1089,7 @@ static av_cold int avisynth_read_close(AVFormatContext *s)
          return AVERROR_UNKNOWN;

      avisynth_context_destroy(s->priv_data);
+    dlclose(avs_library.library);

Maybe it's best to wrap this around an if (avs_library.library).


True. I had tried toying around with C11 _Thread_local since we now
use C17 as the default std, and in that case there was what I presume
was a double free happening that required adding a check for whether
avs_library.library still existed.  As that hadn't been happening prior
to that test I didn't really think much of it, but yeah, it would
make sense to check it anyway.

I abandoned that general idea after 1) finding out that while GCC and
Clang are fine, MSVC doesn't seem to yet (or if it does, only the
most recent versions of MSVC 2022 do) 2) C23 renamed it to thread_local,
and most importantly, 3) I probably hadn't quite used it entirely
correctly, because while the script could be parsed and played back just
fine, trying to encode anything from it would segfault.

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to