
+ #include <assert.h>

int av_hwframe_ctx_init(AVBufferRef *ref)
{
+    assert(ref != NULL);
     AVHWFramesContext *ctx = (AVHWFramesContext*)ref->data;
     // ... rest of the function
