aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vulkan_h264.c
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2023-06-22 04:59:40 +0200
committerLynne <dev@lynne.ee>2023-06-22 18:18:53 +0200
commit997d8a7e73a9b9f00e4bc32ed3b41b30d2e39cf8 (patch)
tree9968c21663ee1189a66b38fd0d09d041fc22cbf5 /libavcodec/vulkan_h264.c
parent4ff303a7b827de2179c6e346959e36960e57b5ba (diff)
downloadffmpeg-997d8a7e73a9b9f00e4bc32ed3b41b30d2e39cf8.tar.gz
vulkan_decode: reject decoding of frames with no slices
As per the spec: VUID-VkVideoDecodeH264PictureInfoKHR-sliceCount-arraylength sliceCount must be greater than 0 VUID-VkVideoDecodeH265PictureInfoKHR-sliceSegmentCount-arraylength sliceSegmentCount must be greater than 0 This particularly happens with seeking in field-coded H264.
Diffstat (limited to 'libavcodec/vulkan_h264.c')
-rw-r--r--libavcodec/vulkan_h264.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/vulkan_h264.c b/libavcodec/vulkan_h264.c
index 62e350266a..089a181bb4 100644
--- a/libavcodec/vulkan_h264.c
+++ b/libavcodec/vulkan_h264.c
@@ -517,6 +517,9 @@ static int vk_h264_end_frame(AVCodecContext *avctx)
FFVulkanDecodePicture *rvp[H264_MAX_PICTURE_COUNT] = { 0 };
AVFrame *rav[H264_MAX_PICTURE_COUNT] = { 0 };
+ if (!hp->h264_pic_info.sliceCount)
+ return 0;
+
if (!dec->session_params) {
int err = vk_h264_create_params(avctx, &dec->session_params);
if (err < 0)