[FFmpeg-devel] [PATCH 06/11] avcodec/vaapi_encode: fix potential uninitialized read

Timo Rothenpieler timo at rothenpieler.org
Sun Jun 11 17:05:48 EEST 2017


Fixes CID 1400440
---
 libavcodec/vaapi_encode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 7e9c00f51d..9336bbecd4 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -738,7 +738,7 @@ fail:
 static int vaapi_encode_truncate_gop(AVCodecContext *avctx)
 {
     VAAPIEncodeContext *ctx = avctx->priv_data;
-    VAAPIEncodePicture *pic, *last_pic, *next;
+    VAAPIEncodePicture *pic, *last_pic = NULL, *next;
 
     // Find the last picture we actually have input for.
     for (pic = ctx->pic_start; pic; pic = pic->next) {
-- 
2.13.0



More information about the ffmpeg-devel mailing list