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

Fatal error. System.AccessViolationException when trying to dispose video stream #114

Closed
ggolda opened this issue Apr 25, 2022 · 3 comments

Comments

@ggolda
Copy link

ggolda commented Apr 25, 2022

Error with library version 4.4.0, happens when I try to dispose a video stream:

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at FFMediaToolkit.Decoding.Internal.Decoder.DiscardBufferedData()
   at FFMediaToolkit.Decoding.MediaStream.Dispose()
   at FFMediaToolkit.Decoding.VideoStream.Dispose()

Video stream is created using code sample below:

          MediaOptions options = new MediaOptions()
          {
              StreamsToLoad = MediaMode.Video,
              VideoPixelFormat = ImagePixelFormat.Rgba32,
          };

          _file = MediaFile.Open(filePath, options);
          if (!_file.HasVideo)
          {
              throw new Exception($"Can't create video resource. Source file of resource {id} doesn't have video stream.");
          }

          _videoStream = _file.Video;

Works fine with version 4.1.1

@radek-k
Copy link
Owner

radek-k commented Apr 25, 2022

Fixed in v4.4.1

@radek-k radek-k closed this as completed Apr 25, 2022
@ggolda
Copy link
Author

ggolda commented Apr 25, 2022

Thanks!

@tghanem
Copy link

tghanem commented May 30, 2022

Not sure if it's related to this thread but I got it when disposing the MediaOutput object in the latest version (i.e., 4.4.1).

It happens rarely, so it's very hard to repro and capture more information but I have a screenshot.

AccessViolationOnDispose

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

3 participants