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

Access violation and heap corruption when disposing MediaFile object #61

Closed
mohelwazer opened this issue Jan 13, 2021 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@mohelwazer
Copy link

Open any video file var mediaFile = MediaFile.Open(videoPath); then I got all the frames using TryReadNextFrame(out ImageData).
Then I wanted to dispose the mediaFile after that a heap corruption or access violation happens.
I have traced the problem to InputContainer class, OnDisposing() method line marked with ->>>>

protected override void OnDisposing()
{
     Video?.Dispose();
  
      var ptr = Pointer;
      ffmpeg.avformat_close_input(&ptr);
  
      // Note: the internal buffer could have changed, and be != avio_ctx_buffer
      if (Pointer->pb != null)
      {
          ffmpeg.av_free(Pointer->pb->buffer);
          
          ->>>>  ffmpeg.avio_context_free(&Pointer->pb);
      }
}
@radek-k radek-k added the bug Something isn't working label Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants