[FFmpeg-devel] [PATCH 1/3] nutdec: initialize has_keyframe[0]

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Fri May 22 23:36:17 CEST 2015


If x is 2 it is not initialized before it is used.

This fixes 'Conditional jump or move depends on uninitialised value(s)'
valgrind warnings.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
---
 libavformat/nutdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index f1cece8..935adea 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -690,6 +690,7 @@ static int find_and_decode_index(NUTContext *nut)
     GET_V(syncpoint_count, tmp < INT_MAX / 8 && tmp > 0);
     syncpoints   = av_malloc_array(syncpoint_count, sizeof(int64_t));
     has_keyframe = av_malloc_array(syncpoint_count + 1, sizeof(int8_t));
+    has_keyframe[0] = 0;
     if (!syncpoints || !has_keyframe) {
         ret = AVERROR(ENOMEM);
         goto fail;
-- 
2.1.4


More information about the ffmpeg-devel mailing list