Revision 09f20d37

View differences:

libavcodec/flac.c
591 591
    int16_t *samples = data;
592 592

  
593 593
    if(s->max_framesize == 0){
594
        s->max_framesize= 8192; // should hopefully be enough for the first header
594
        s->max_framesize= 65536; // should hopefully be enough for the first header
595 595
        s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
596 596
    }
597 597

  
598 598
    if(1 && s->max_framesize){//FIXME truncated
599
            buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
599
            buf_size= FFMAX(FFMIN(buf_size, s->max_framesize - s->bitstream_size), 0);
600 600
            input_buf_size= buf_size;
601 601

  
602 602
            if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){
......
638 638
                    int bits_count= get_bits_count(&s->gb);
639 639

  
640 640
                    metadata_streaminfo(s);
641
                    buf= &s->bitstream[s->bitstream_index];
642
                    init_get_bits(&s->gb, buf, buf_size*8);
643
                    skip_bits(&s->gb, bits_count);
644 641

  
645 642
                    dump_headers(s);
646 643
                    break;}

Also available in: Unified diff