aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorDavid Rosca <nowrep@gmail.com>2024-05-13 09:38:49 +0200
committerHaihao Xiang <haihao.xiang@intel.com>2024-05-21 16:57:46 +0800
commitf7a1453f27583c36a3417c4a731b45ac4235b660 (patch)
tree09ef8d16afa599121dc1c9fc47e218e6a16256d2 /libavcodec
parent45d31614bcc54c5ccbaabf07e7336ac477e2b424 (diff)
downloadffmpeg-f7a1453f27583c36a3417c4a731b45ac4235b660.tar.gz
lavc/vaapi_decode: Reject decoding of frames with no slices
Matches other hwaccels.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vaapi_decode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index 21b273cd0f..7f2fe032db 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -156,6 +156,11 @@ int ff_vaapi_decode_issue(AVCodecContext *avctx,
VAStatus vas;
int err;
+ if (pic->nb_slices <= 0) {
+ err = AVERROR(EINVAL);
+ goto fail;
+ }
+
av_log(avctx, AV_LOG_DEBUG, "Decode to surface %#x.\n",
pic->output_surface);