From 4ae43a1c40b2e6f96ce2c62bc5f16d55f91436f5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 15 Dec 2019 23:40:11 +0100 Subject: vd_lavc: fix broken assert() This assert() sometimes triggered (and still triggers) with lavc API bugs. It tries to check that at least 1 plane is set to a non-NULL value. Obviously, a valid frame returned by successful decoding should never have it. The problem is that some hwdecs use integer surface IDs cast to a pointer. Recently, it happened that newer Intel drivers started using surface ID 0 under certain circumstances (for unknown reasons), which triggers this assert. Just get rid of it. For the sake of #7185, add an assert() specifically for nvdec. That failure needs to be further analyzed, is probably a FFmpeg bug, and without this assert() would just crash somewhere further down the video chain. Fixes: #7261 --- video/decode/vd_lavc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 0fe3edd7ac..2acfa9a9c0 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -1062,7 +1062,8 @@ static int decode_frame(struct mp_filter *vd) av_frame_unref(ctx->pic); return ret; } - assert(mpi->planes[0] || mpi->planes[3]); + if (mpi->imgfmt == IMGFMT_CUDA) + assert(mpi->planes[0]); mpi->pts = mp_pts_from_av(ctx->pic->pts, &ctx->codec_timebase); mpi->dts = mp_pts_from_av(ctx->pic->pkt_dts, &ctx->codec_timebase); -- cgit v1.2.3