Revision fbe8c56d

View differences:

libavformat/oggenc.c
61 61
    } else if (oggstream->eos)
62 62
        flags |= 4;
63 63

  
64
    page_segments = FFMIN((size/255)+!!size, 255);
64
    page_segments = FFMIN(size/255 + 1, 255);
65 65

  
66 66
    init_checksum(s->pb, ff_crc04C11DB7_update, 0);
67 67
    put_tag(s->pb, "OggS");
......
75 75
    put_byte(s->pb, page_segments);
76 76
    for (i = 0; i < page_segments-1; i++)
77 77
        put_byte(s->pb, 255);
78
    if (size) {
79
        put_byte(s->pb, size - (page_segments-1)*255);
80
        put_buffer(s->pb, data, size);
81
    }
78
    put_byte(s->pb, size - (page_segments-1)*255);
79
    put_buffer(s->pb, data, size);
80

  
82 81
    ogg_update_checksum(s, crc_offset);
83 82
    put_flush_packet(s->pb);
84 83
    return size;

Also available in: Unified diff