Revision 91078926 libavcodec/h264.c

View differences:

libavcodec/h264.c
614 614
}
615 615

  
616 616

  
617
static void free_tables(H264Context *h){
617
static void free_tables(H264Context *h, int free_rbsp){
618 618
    int i;
619 619
    H264Context *hx;
620 620
    av_freep(&h->intra4x4_pred_mode);
......
637 637
        av_freep(&hx->top_borders[1]);
638 638
        av_freep(&hx->top_borders[0]);
639 639
        av_freep(&hx->s.obmc_scratchpad);
640
        if (free_rbsp){
640 641
        av_freep(&hx->rbsp_buffer[1]);
641 642
        av_freep(&hx->rbsp_buffer[0]);
642 643
        hx->rbsp_buffer_size[0] = 0;
643 644
        hx->rbsp_buffer_size[1] = 0;
645
        }
644 646
        if (i) av_freep(&h->thread_context[i]);
645 647
    }
646 648
}
......
748 750

  
749 751
    return 0;
750 752
fail:
751
    free_tables(h);
753
    free_tables(h, 1);
752 754
    return -1;
753 755
}
754 756

  
......
1776 1778
            || av_cmp_q(h->sps.sar, s->avctx->sample_aspect_ratio))) {
1777 1779
        if(h != h0)
1778 1780
            return -1;   // width / height changed during parallelized decoding
1779
        free_tables(h);
1781
        free_tables(h, 0);
1780 1782
        flush_dpb(s->avctx);
1781 1783
        MPV_common_end(s);
1782 1784
    }
......
3331 3333
{
3332 3334
    int i;
3333 3335

  
3334
    free_tables(h); //FIXME cleanup init stuff perhaps
3336
    free_tables(h, 1); //FIXME cleanup init stuff perhaps
3335 3337

  
3336 3338
    for(i = 0; i < MAX_SPS_COUNT; i++)
3337 3339
        av_freep(h->sps_buffers + i);

Also available in: Unified diff