This small memory leak was essentially responsible for keeping decoding working at all. The issue is that the codec profile must be attached to the frames context. We created the codec profile at decoder creation time. Which meant that if the decoder was destroyed, the context became essentially useless, and segfaulted as the profile was a hanging pointer. This was an issue that happened when seeking through H264. This requires using the new AVHWFramesContext.opaque field, as otherwise, the profile attached to the decoder will be freed before the frames context, rendering the frames context useless. Patch attached.