Revision e63a3628 libavformat/idcin.c

View differences:

libavformat/idcin.c
149 149
    unsigned int sample_rate, bytes_per_sample, channels;
150 150

  
151 151
    /* get the 5 header parameters */
152
    width = get_le32(pb);
153
    height = get_le32(pb);
154
    sample_rate = get_le32(pb);
155
    bytes_per_sample = get_le32(pb);
156
    channels = get_le32(pb);
152
    width = avio_rl32(pb);
153
    height = avio_rl32(pb);
154
    sample_rate = avio_rl32(pb);
155
    bytes_per_sample = avio_rl32(pb);
156
    channels = avio_rl32(pb);
157 157

  
158 158
    st = av_new_stream(s, 0);
159 159
    if (!st)
......
169 169
    /* load up the Huffman tables into extradata */
170 170
    st->codec->extradata_size = HUFFMAN_TABLE_SIZE;
171 171
    st->codec->extradata = av_malloc(HUFFMAN_TABLE_SIZE);
172
    if (get_buffer(pb, st->codec->extradata, HUFFMAN_TABLE_SIZE) !=
172
    if (avio_read(pb, st->codec->extradata, HUFFMAN_TABLE_SIZE) !=
173 173
        HUFFMAN_TABLE_SIZE)
174 174
        return AVERROR(EIO);
175 175
    /* save a reference in order to transport the palette */
......
231 231
        return AVERROR(EIO);
232 232

  
233 233
    if (idcin->next_chunk_is_video) {
234
        command = get_le32(pb);
234
        command = avio_rl32(pb);
235 235
        if (command == 2) {
236 236
            return AVERROR(EIO);
237 237
        } else if (command == 1) {
238 238
            /* trigger a palette change */
239 239
            idcin->palctrl.palette_changed = 1;
240
            if (get_buffer(pb, palette_buffer, 768) != 768)
240
            if (avio_read(pb, palette_buffer, 768) != 768)
241 241
                return AVERROR(EIO);
242 242
            /* scale the palette as necessary */
243 243
            palette_scale = 2;
......
255 255
            }
256 256
        }
257 257

  
258
        chunk_size = get_le32(pb);
258
        chunk_size = avio_rl32(pb);
259 259
        /* skip the number of decoded bytes (always equal to width * height) */
260 260
        url_fseek(pb, 4, SEEK_CUR);
261 261
        chunk_size -= 4;

Also available in: Unified diff