Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash connecting to udp endpoints that don't exist #317

Open
ispysoftware opened this issue Feb 25, 2025 · 1 comment
Open

Crash connecting to udp endpoints that don't exist #317

ispysoftware opened this issue Feb 25, 2025 · 1 comment

Comments

@ispysoftware
Copy link

ispysoftware commented Feb 25, 2025

Hello!
This throws a fatal abort exception that i can't catch in managed code. Any workarounds? Doesn't fail hard in ffplay or ffmpeg.exe

Wasn't happening on ffmpeg 6

public static bool TestUDP()
{
    ffmpeg.RootPath = @"D:\Projects\UDPTest\ffmpeg";
    ffmpeg.av_log_set_level(ffmpeg.AV_LOG_VERBOSE);
    int timeoutSeconds = 5;
    string url = "udp://127.0.0.1:56000";
    ffmpeg.avformat_network_init();

    AVFormatContext* formatContext = null;
    AVDictionary* options = null;
    bool success = false;

    try
    {
        int timeoutMicroseconds = timeoutSeconds * 1000000;
        int result = ffmpeg.avformat_open_input(&formatContext, url, null, &options); //<-- fatal crash
        success = (result >= 0);
        return success;
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Exception: {ex.Message}");
        return false;
    }
    finally
    {

        if (formatContext != null)
        {
            ffmpeg.avformat_close_input(&formatContext);
        }
    }

}
@ispysoftware
Copy link
Author

ispysoftware commented Feb 25, 2025

it might be related to
BtbN/FFmpeg-Builds#412

edit 2 - doesn't seem to happen on release build so not critical

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant