Revision e31a7441

View differences:

libavcodec/dvbsubdec.c
332 332
        ctx->region_list = region->next;
333 333

  
334 334
        delete_region_display_list(ctx, region);
335
        if (region->pbuf)
336
            av_free(region->pbuf);
337

  
335
        av_free(region->pbuf);
338 336
        av_free(region);
339 337
    }
340 338

  
......
1032 1030
    buf += 2;
1033 1031

  
1034 1032
    if (region->width * region->height != region->buf_size) {
1035
        if (region->pbuf)
1036
            av_free(region->pbuf);
1033
        av_free(region->pbuf);
1037 1034

  
1038 1035
        region->buf_size = region->width * region->height;
1039 1036

  
libavcodec/flashsv.c
133 133
    /* the block size could change between frames, make sure the buffer
134 134
     * is large enough, if not, get a larger one */
135 135
    if(s->block_size < s->block_width*s->block_height) {
136
        if (s->tmpblock != NULL)
137
            av_free(s->tmpblock);
136
        av_free(s->tmpblock);
138 137
        if ((s->tmpblock = av_malloc(3*s->block_width*s->block_height)) == NULL) {
139 138
            av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
140 139
            return -1;
......
243 242
        avctx->release_buffer(avctx, &s->frame);
244 243

  
245 244
    /* free the tmpblock */
246
    if (s->tmpblock != NULL)
247
        av_free(s->tmpblock);
245
    av_free(s->tmpblock);
248 246

  
249 247
    return 0;
250 248
}
libavcodec/libxvidff.c
533 533
        av_free(x->twopassbuffer);
534 534
        av_free(x->old_twopassbuffer);
535 535
    }
536
    if( x->twopassfile != NULL )
537
        av_free(x->twopassfile);
538
    if( x->intra_matrix != NULL )
539
        av_free(x->intra_matrix);
540
    if( x->inter_matrix != NULL )
541
        av_free(x->inter_matrix);
536
    av_free(x->twopassfile);
537
    av_free(x->intra_matrix);
538
    av_free(x->inter_matrix);
542 539

  
543 540
    return 0;
544 541
}
libavcodec/mpegaudiodec.c
2227 2227
    int i;
2228 2228

  
2229 2229
    for (i = 0; i < s->frames; i++)
2230
        if (s->mp3decctx[i])
2231
            av_free(s->mp3decctx[i]);
2230
        av_free(s->mp3decctx[i]);
2232 2231

  
2233 2232
    return 0;
2234 2233
}
libavcodec/smacker.c
677 677
    for(i = 0; i < 4; i++) {
678 678
        if(vlc[i].table)
679 679
            free_vlc(&vlc[i]);
680
        if(h[i].bits)
681
            av_free(h[i].bits);
682
        if(h[i].lengths)
683
            av_free(h[i].lengths);
684
        if(h[i].values)
685
            av_free(h[i].values);
680
        av_free(h[i].bits);
681
        av_free(h[i].lengths);
682
        av_free(h[i].values);
686 683
    }
687 684

  
688 685
    *data_size = unp_size;
libavcodec/truemotion2.c
185 185

  
186 186
static void tm2_free_codes(TM2Codes *code)
187 187
{
188
    if(code->recode)
189
        av_free(code->recode);
188
    av_free(code->recode);
190 189
    if(code->vlc.table)
191 190
        free_vlc(&code->vlc);
192 191
}
......
859 858
    AVFrame *pic = &l->pic;
860 859
    int i;
861 860

  
862
    if(l->last)
863
        av_free(l->last);
864
    if(l->clast)
865
        av_free(l->clast);
861
    av_free(l->last);
862
    av_free(l->clast);
866 863
    for(i = 0; i < TM2_NUM_STREAMS; i++)
867
        if(l->tokens[i])
868
            av_free(l->tokens[i]);
864
        av_free(l->tokens[i]);
869 865
    if(l->Y1){
870 866
        av_free(l->Y1);
871 867
        av_free(l->U1);
libavcodec/tta.c
449 449
static av_cold int tta_decode_close(AVCodecContext *avctx) {
450 450
    TTAContext *s = avctx->priv_data;
451 451

  
452
    if (s->decode_buffer)
453
        av_free(s->decode_buffer);
452
    av_free(s->decode_buffer);
454 453
    av_freep(&s->ch_ctx);
455 454

  
456 455
    return 0;
libavformat/rtpdec_mpeg4.c
111 111
{
112 112
    /* decode the hexa encoded parameter */
113 113
    int len = ff_hex_to_data(NULL, value);
114
    if (codec->extradata)
115
        av_free(codec->extradata);
114
    av_free(codec->extradata);
116 115
    codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
117 116
    if (!codec->extradata)
118 117
        return AVERROR(ENOMEM);
libavformat/smacker.c
334 334
    int i;
335 335

  
336 336
    for(i = 0; i < 7; i++)
337
        if(smk->bufs[i])
338
            av_free(smk->bufs[i]);
339
    if(smk->frm_size)
340
        av_free(smk->frm_size);
341
    if(smk->frm_flags)
342
        av_free(smk->frm_flags);
337
        av_free(smk->bufs[i]);
338
    av_free(smk->frm_size);
339
    av_free(smk->frm_flags);
343 340

  
344 341
    return 0;
345 342
}

Also available in: Unified diff