Re: [FFmpeg-devel] [PATCH v2] lavc/vaapi_decode: Reject decoding of frames with no slices

2024-05-19 Thread Xiang, Haihao
On Ma, 2024-05-13 at 09:38 +0200, David Rosca wrote:
> Matches other hwaccels.
> ---
> v2: AVERROR
> 
>  libavcodec/vaapi_decode.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> index 8e9f647c20..7c91d50f7b 100644
> --- a/libavcodec/vaapi_decode.c
> +++ b/libavcodec/vaapi_decode.c
> @@ -157,6 +157,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);
>  

LGTM, will apply

Thanks
Haihao

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v2] lavc/vaapi_decode: Reject decoding of frames with no slices

2024-05-13 Thread David Rosca
Matches other hwaccels.
---
v2: AVERROR

 libavcodec/vaapi_decode.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index 8e9f647c20..7c91d50f7b 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -157,6 +157,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);
 
-- 
2.45.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".