On Tue, Nov 11, 2014 at 1:26 PM, Vittorio Giovara
<vittorio.giov...@gmail.com> wrote:
> From: Luca Barbato <lu_z...@gentoo.org>
>
> Prevent an uninitialized data access.
>
> CC: libav-sta...@libav.org
> Bug-Id: CID 703824 / CID 703825
> ---
>  libavcodec/proresenc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/proresenc.c b/libavcodec/proresenc.c
> index df9b834..7209f34 100644
> --- a/libavcodec/proresenc.c
> +++ b/libavcodec/proresenc.c
> @@ -758,7 +758,8 @@ static int find_slice_quant(AVCodecContext *avctx, const 
> AVFrame *pic,
>      const int max_quant = ctx->profile_info->max_quant;
>      int error, bits, bits_limit;
>      int mbs, prev, cur, new_score;
> -    int slice_bits[TRELLIS_WIDTH], slice_score[TRELLIS_WIDTH];
> +    int slice_bits[TRELLIS_WIDTH] = { 0 };
> +    int slice_score[TRELLIS_WIDTH] = { 0 };
>      int overquant;
>      uint16_t *qmat;
>      int linesize[4], line_add;
> @@ -821,10 +822,9 @@ static int find_slice_quant(AVCodecContext *avctx, const 
> AVFrame *pic,
>          if (ctx->alpha_bits)
>              bits += estimate_alpha_plane(ctx, &error, src, linesize[3],
>                                           mbs_per_slice, q, td->blocks[3]);
> -        if (bits > 65000 * 8) {
> +        if (bits > 65000 * 8)
>              error = SCORE_LIMIT;
> -            break;
> -        }
> +
>          slice_bits[q]  = bits;
>          slice_score[q] = error;
>      }
> --
> 1.9.3 (Apple Git-50)
>

ping

-- 
Vittorio
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to