[FFmpeg-cvslog] ffv1: fix 2 uninitialized variable warnings

Michael Niedermayer git at videolan.org
Mon Sep 3 02:00:12 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Sep  3 01:24:15 2012 +0200| [0b23452c01c5f8145de111f09c0e9a7d5bd82068] | committer: Michael Niedermayer

ffv1: fix 2 uninitialized variable warnings

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0b23452c01c5f8145de111f09c0e9a7d5bd82068
---

 libavcodec/ffv1.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 6650a23..4f90680 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -597,7 +597,7 @@ static void encode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, int
                 sample[p][i]= s->sample_buffer + p*ring_size*(w+6) + ((h+i-y)%ring_size)*(w+6) + 3;
 
         for(x=0; x<w; x++){
-            int b,g,r,a;
+            int b,g,r,av_uninit(a);
             if(lbd){
                 unsigned v= *((uint32_t*)(src[0] + x*4 + stride[0]*y));
                 b= v&0xFF;
@@ -1831,7 +1831,7 @@ static int read_extra_header(FFV1Context *f){
 
 static int read_header(FFV1Context *f){
     uint8_t state[CONTEXT_SIZE];
-    int i, j, context_count;
+    int i, j, context_count = -1; //-1 to avoid warning
     RangeCoder * const c= &f->slice_context[0]->c;
 
     memset(state, 128, sizeof(state));
@@ -2002,6 +2002,7 @@ static int read_header(FFV1Context *f){
             }
 
             if(f->version <= 2){
+                av_assert0(context_count>=0);
                 if(p->context_count < context_count){
                     av_freep(&p->state);
                     av_freep(&p->vlc_state);



More information about the ffmpeg-cvslog mailing list