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

Michael Niedermayer michaelni at gmx.at
Sat May 23 00:42:01 CEST 2015


On Fri, May 22, 2015 at 11:36:17PM +0200, Andreas Cadhalpun wrote:
> 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;

ive added a check for x, this should fix it
btw above also might segfault as its before the NULL check

thanks


>      if (!syncpoints || !has_keyframe) {
>          ret = AVERROR(ENOMEM);
>          goto fail;
> -- 
> 2.1.4
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150523/05de5e36/attachment.asc>


More information about the ffmpeg-devel mailing list