Revision e63a3628 libavformat/c93.c

View differences:

libavformat/c93.c
66 66
    int framecount = 0;
67 67

  
68 68
    for (i = 0; i < 512; i++) {
69
        c93->block_records[i].index = get_le16(pb);
70
        c93->block_records[i].length = get_byte(pb);
71
        c93->block_records[i].frames = get_byte(pb);
69
        c93->block_records[i].index = avio_rl16(pb);
70
        c93->block_records[i].length = avio_r8(pb);
71
        c93->block_records[i].frames = avio_r8(pb);
72 72
        if (c93->block_records[i].frames > 32) {
73 73
            av_log(s, AV_LOG_ERROR, "too many frames in block\n");
74 74
            return AVERROR_INVALIDDATA;
......
114 114
    if (c93->next_pkt_is_audio) {
115 115
        c93->current_frame++;
116 116
        c93->next_pkt_is_audio = 0;
117
        datasize = get_le16(pb);
117
        datasize = avio_rl16(pb);
118 118
        if (datasize > 42) {
119 119
            if (!c93->audio) {
120 120
                c93->audio = av_new_stream(s, 1);
......
142 142
    if (c93->current_frame == 0) {
143 143
        url_fseek(pb, br->index * 2048, SEEK_SET);
144 144
        for (i = 0; i < 32; i++) {
145
            c93->frame_offsets[i] = get_le32(pb);
145
            c93->frame_offsets[i] = avio_rl32(pb);
146 146
        }
147 147
    }
148 148

  
149 149
    url_fseek(pb,br->index * 2048 +
150 150
            c93->frame_offsets[c93->current_frame], SEEK_SET);
151
    datasize = get_le16(pb); /* video frame size */
151
    datasize = avio_rl16(pb); /* video frame size */
152 152

  
153 153
    ret = av_new_packet(pkt, datasize + 768 + 1);
154 154
    if (ret < 0)
......
156 156
    pkt->data[0] = 0;
157 157
    pkt->size = datasize + 1;
158 158

  
159
    ret = get_buffer(pb, pkt->data + 1, datasize);
159
    ret = avio_read(pb, pkt->data + 1, datasize);
160 160
    if (ret < datasize) {
161 161
        ret = AVERROR(EIO);
162 162
        goto fail;
163 163
    }
164 164

  
165
    datasize = get_le16(pb); /* palette size */
165
    datasize = avio_rl16(pb); /* palette size */
166 166
    if (datasize) {
167 167
        if (datasize != 768) {
168 168
            av_log(s, AV_LOG_ERROR, "invalid palette size %u\n", datasize);
......
170 170
            goto fail;
171 171
        }
172 172
        pkt->data[0] |= C93_HAS_PALETTE;
173
        ret = get_buffer(pb, pkt->data + pkt->size, datasize);
173
        ret = avio_read(pb, pkt->data + pkt->size, datasize);
174 174
        if (ret < datasize) {
175 175
            ret = AVERROR(EIO);
176 176
            goto fail;

Also available in: Unified diff