mirror of
https://github.com/mpv-player/mpv
synced 2025-02-13 10:27:12 +00:00
vd_lavc: check for missing device_ctx ref
It's not really guaranteed that other components always set this (e.g. on subtle errors), so check it explicitly. Although I'm not aware of a failing case.
This commit is contained in:
parent
2a04906063
commit
2426f95e0f
@ -750,6 +750,11 @@ int hwdec_setup_hw_frames_ctx(struct lavc_ctx *ctx, AVBufferRef *device_ctx,
|
||||
int h = ctx->avctx->coded_height;
|
||||
int av_hw_format = imgfmt2pixfmt(ctx->hwdec_fmt);
|
||||
|
||||
if (!device_ctx) {
|
||||
MP_ERR(ctx, "Missing device context.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ctx->cached_hw_frames_ctx) {
|
||||
AVHWFramesContext *fctx = (void *)ctx->cached_hw_frames_ctx->data;
|
||||
if (fctx->width != w || fctx->height != h ||
|
||||
|
Loading…
Reference in New Issue
Block a user