Revision 01dbbd0a

View differences:

libavcodec/mpegvideo.c
180 180
        s->coded_block = av_mallocz(y_size);
181 181
        if (!s->coded_block)
182 182
            goto fail;
183
    }
183 184

  
184 185
        /* which mb is a intra block */
185
        s->mbintra_table = av_mallocz(y_size/4);
186
        s->mbintra_table = av_mallocz(s->mb_width * s->mb_height);
186 187
        if (!s->mbintra_table)
187 188
            goto fail;
188
        memset(s->mbintra_table, 1, y_size/4);
189
    }
189
        memset(s->mbintra_table, 1, s->mb_width * s->mb_height);
190 190
    /* default structure is frame */
191 191
    s->picture_structure = PICT_FRAME;
192 192

  
......
209 209
    if (s->coded_block)
210 210
        free(s->coded_block);
211 211
    if (s->mbintra_table)
212
        free(s->mbintra_table);
212
        { free(s->mbintra_table);s->mbintra_table=NULL; }
213 213
    if (s->mbskip_table)
214 214
        free(s->mbskip_table);
215 215
    for(i=0;i<3;i++) {
......
234 234
        free(s->dc_val[0]);
235 235
        free(s->ac_val[0]);
236 236
        free(s->coded_block);
237
        free(s->mbintra_table);
237
        { free(s->mbintra_table);s->mbintra_table=NULL; }
238 238
    }
239 239
    if (s->mbskip_table)
240 240
        free(s->mbskip_table);

Also available in: Unified diff