diff mbox series

[FFmpeg-devel,v1] avcodec/libx265: Fix Uninitialized scalar variable

Message ID 20200109105245.3950-1-lance.lmwang@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,v1] avcodec/libx265: Fix Uninitialized scalar variable
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Limin Wang Jan. 9, 2020, 10:52 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Fixes CID 1457234

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/libx265.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Derek Buitenhuis Jan. 13, 2020, 4:19 p.m. UTC | #1
On 09/01/2020 10:52, lance.lmwang@gmail.com wrote:
> +    default:
> +        pict_type = AV_PICTURE_TYPE_NONE;

Is this ever possible to actually hit in the API, though?

Maybe more useful to return an error in such a case, since something
is really wrong probably?

- Derek
Limin Wang Jan. 14, 2020, 1:21 a.m. UTC | #2
On Mon, Jan 13, 2020 at 04:19:10PM +0000, Derek Buitenhuis wrote:
> On 09/01/2020 10:52, lance.lmwang@gmail.com wrote:
> > +    default:
> > +        pict_type = AV_PICTURE_TYPE_NONE;
> 
> Is this ever possible to actually hit in the API, though?
> 
> Maybe more useful to return an error in such a case, since something
> is really wrong probably?

It's OK to return an error from my side, I'm use the same way like libx264,
if prefer to such way, it's better to change libx264 to return error also.


> 
> - Derek
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 9e4711e50b..7f18db92e4 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -549,6 +549,8 @@  static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     case X265_TYPE_BREF:
         pict_type = AV_PICTURE_TYPE_B;
         break;
+    default:
+        pict_type = AV_PICTURE_TYPE_NONE;
     }
 
 #if FF_API_CODED_FRAME