diff mbox series

[FFmpeg-devel,v3,1/3] avcodec/libx265: Fix Uninitialized scalar variable

Message ID 20200418045249.8057-1-lance.lmwang@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,v3,1/3] avcodec/libx265: Fix Uninitialized scalar variable | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Lance Wang April 18, 2020, 4:52 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

return error if unknown picture type encountered

Fixes CID 1457234
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
haven't merge yet, so rebase to the git master

 libavcodec/libx265.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Lance Wang May 7, 2020, 2:40 p.m. UTC | #1
On Sat, Apr 18, 2020 at 12:52:47PM +0800, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> return error if unknown picture type encountered
> 
> Fixes CID 1457234
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
> haven't merge yet, so rebase to the git master
> 
>  libavcodec/libx265.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
> index e42c7b4..573ecc8 100644
> --- a/libavcodec/libx265.c
> +++ b/libavcodec/libx265.c
> @@ -550,6 +550,9 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
>      case X265_TYPE_BREF:
>          pict_type = AV_PICTURE_TYPE_B;
>          break;
> +    default:
> +        av_log(avctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
> +        return AVERROR_EXTERNAL;
>      }

will apply the patch set tomorrow if no comments.

>  
>  #if FF_API_CODED_FRAME
> -- 
> 2.9.5
>
diff mbox series

Patch

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index e42c7b4..573ecc8 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -550,6 +550,9 @@  static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     case X265_TYPE_BREF:
         pict_type = AV_PICTURE_TYPE_B;
         break;
+    default:
+        av_log(avctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
+        return AVERROR_EXTERNAL;
     }
 
 #if FF_API_CODED_FRAME