Revision b7effd4e libavformat/avs.c

View differences:

libavformat/avs.c
62 62
    s->ctx_flags |= AVFMTCTX_NOHEADER;
63 63

  
64 64
    url_fskip(s->pb, 4);
65
    avs->width = get_le16(s->pb);
66
    avs->height = get_le16(s->pb);
67
    avs->bits_per_sample = get_le16(s->pb);
68
    avs->fps = get_le16(s->pb);
69
    avs->nb_frames = get_le32(s->pb);
65
    avs->width = avio_rl16(s->pb);
66
    avs->height = avio_rl16(s->pb);
67
    avs->bits_per_sample = avio_rl16(s->pb);
68
    avs->fps = avio_rl16(s->pb);
69
    avs->nb_frames = avio_rl32(s->pb);
70 70
    avs->remaining_frame_size = 0;
71 71
    avs->remaining_audio_size = 0;
72 72

  
......
104 104
    pkt->data[palette_size + 1] = type;
105 105
    pkt->data[palette_size + 2] = size & 0xFF;
106 106
    pkt->data[palette_size + 3] = (size >> 8) & 0xFF;
107
    ret = get_buffer(s->pb, pkt->data + palette_size + 4, size - 4) + 4;
107
    ret = avio_read(s->pb, pkt->data + palette_size + 4, size - 4) + 4;
108 108
    if (ret < size) {
109 109
        av_free_packet(pkt);
110 110
        return AVERROR(EIO);
......
154 154

  
155 155
    while (1) {
156 156
        if (avs->remaining_frame_size <= 0) {
157
            if (!get_le16(s->pb))    /* found EOF */
157
            if (!avio_rl16(s->pb))    /* found EOF */
158 158
                return AVERROR(EIO);
159
            avs->remaining_frame_size = get_le16(s->pb) - 4;
159
            avs->remaining_frame_size = avio_rl16(s->pb) - 4;
160 160
        }
161 161

  
162 162
        while (avs->remaining_frame_size > 0) {
163
            sub_type = get_byte(s->pb);
164
            type = get_byte(s->pb);
165
            size = get_le16(s->pb);
163
            sub_type = avio_r8(s->pb);
164
            type = avio_r8(s->pb);
165
            size = avio_rl16(s->pb);
166 166
            avs->remaining_frame_size -= size;
167 167

  
168 168
            switch (type) {
169 169
            case AVS_PALETTE:
170
                ret = get_buffer(s->pb, palette, size - 4);
170
                ret = avio_read(s->pb, palette, size - 4);
171 171
                if (ret < size - 4)
172 172
                    return AVERROR(EIO);
173 173
                palette_size = size;

Also available in: Unified diff