1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-03 14:32:16 +02:00

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.
This commit is contained in:
Lynne 2023-06-22 04:59:40 +02:00
parent 4ff303a7b8
commit 997d8a7e73
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464
3 changed files with 9 additions and 0 deletions

View File

@ -535,6 +535,9 @@ static int vk_av1_end_frame(AVCodecContext *avctx)
FFVulkanDecodePicture *rvp[AV1_NUM_REF_FRAMES] = { 0 };
AVFrame *rav[AV1_NUM_REF_FRAMES] = { 0 };
if (!ap->tile_list.nb_tiles)
return 0;
if (!dec->session_params) {
int err = vk_av1_create_params(avctx, &dec->session_params);
if (err < 0)

View File

@ -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)

View File

@ -901,6 +901,9 @@ static int vk_hevc_end_frame(AVCodecContext *avctx)
FFVulkanDecodePicture *rvp[HEVC_MAX_REFS] = { 0 };
AVFrame *rav[HEVC_MAX_REFS] = { 0 };
if (!hp->h265_pic_info.sliceSegmentCount)
return 0;
if (!dec->session_params) {
const HEVCSPS *sps = h->ps.sps;
const HEVCPPS *pps = h->ps.pps;