diff mbox series

[FFmpeg-devel,2/4] lavc/qsvdec: check ff_decode_frame_props() return value

Message ID 20230105110756.473-2-anton@khirnov.net
State Accepted
Commit 5bf8f29135a6fd3fb2e887c7a37f3594eff97db8
Headers show
Series [FFmpeg-devel,1/4] lavc/ac3dec: fail when the sample rate is unset | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Jan. 5, 2023, 11:07 a.m. UTC
---
 libavcodec/qsvdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Xiang, Haihao Jan. 6, 2023, 1:34 a.m. UTC | #1
On Do, 2023-01-05 at 12:07 +0100, Anton Khirnov wrote:
> ---
>  libavcodec/qsvdec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
> index 92bfea196e..6bc85116ad 100644
> --- a/libavcodec/qsvdec.c
> +++ b/libavcodec/qsvdec.c
> @@ -128,7 +128,9 @@ static int qsv_get_continuous_buffer(AVCodecContext
> *avctx, AVFrame *frame,
>  {
>      int ret = 0;
>  
> -    ff_decode_frame_props(avctx, frame);
> +    ret = ff_decode_frame_props(avctx, frame);
> +    if (ret < 0)
> +        return ret;
>  
>      frame->width       = avctx->width;
>      frame->height      = avctx->height;

LGTM, thx

-Haihao
diff mbox series

Patch

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 92bfea196e..6bc85116ad 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -128,7 +128,9 @@  static int qsv_get_continuous_buffer(AVCodecContext *avctx, AVFrame *frame,
 {
     int ret = 0;
 
-    ff_decode_frame_props(avctx, frame);
+    ret = ff_decode_frame_props(avctx, frame);
+    if (ret < 0)
+        return ret;
 
     frame->width       = avctx->width;
     frame->height      = avctx->height;