From: Luca Barbato <lu_z...@gentoo.org>

Prevent an uninitialized data access.

CC: libav-sta...@libav.org
Bug-Id: CID 703824 / CID 703825
Signed-off-by: Vittorio Giovara <vittorio.giov...@gmail.com>
---
 libavcodec/proresenc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/proresenc.c b/libavcodec/proresenc.c
index 3a82c2c..7c39c23 100644
--- a/libavcodec/proresenc.c
+++ b/libavcodec/proresenc.c
@@ -757,7 +757,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] = { SCORE_LIMIT };
+    int slice_score[TRELLIS_WIDTH] = { SCORE_LIMIT };
     int overquant;
     uint16_t *qmat;
     int linesize[4], line_add;
@@ -820,10 +821,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)

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

Reply via email to