Revision e63a3628 libavformat/wc3movie.c

View differences:

libavformat/wc3movie.c
105 105

  
106 106
    /* traverse through the chunks and load the header information before
107 107
     * the first BRCH tag */
108
    fourcc_tag = get_le32(pb);
109
    size = (get_be32(pb) + 1) & (~1);
108
    fourcc_tag = avio_rl32(pb);
109
    size = (avio_rb32(pb) + 1) & (~1);
110 110

  
111 111
    do {
112 112
        switch (fourcc_tag) {
......
127 127
            buffer = av_malloc(size+1);
128 128
            if (!buffer)
129 129
                return AVERROR(ENOMEM);
130
            if ((ret = get_buffer(pb, buffer, size)) != size)
130
            if ((ret = avio_read(pb, buffer, size)) != size)
131 131
                return AVERROR(EIO);
132 132
            buffer[size] = 0;
133 133
            av_metadata_set2(&s->metadata, "title", buffer,
......
136 136

  
137 137
        case SIZE_TAG:
138 138
            /* video resolution override */
139
            wc3->width  = get_le32(pb);
140
            wc3->height = get_le32(pb);
139
            wc3->width  = avio_rl32(pb);
140
            wc3->height = avio_rl32(pb);
141 141
            break;
142 142

  
143 143
        case PALT_TAG:
......
154 154
            break;
155 155
        }
156 156

  
157
        fourcc_tag = get_le32(pb);
157
        fourcc_tag = avio_rl32(pb);
158 158
        /* chunk sizes are 16-bit aligned */
159
        size = (get_be32(pb) + 1) & (~1);
159
        size = (avio_rb32(pb) + 1) & (~1);
160 160
        if (url_feof(pb))
161 161
            return AVERROR(EIO);
162 162

  
......
205 205

  
206 206
    while (!packet_read) {
207 207

  
208
        fourcc_tag = get_le32(pb);
208
        fourcc_tag = avio_rl32(pb);
209 209
        /* chunk sizes are 16-bit aligned */
210
        size = (get_be32(pb) + 1) & (~1);
210
        size = (avio_rb32(pb) + 1) & (~1);
211 211
        if (url_feof(pb))
212 212
            return AVERROR(EIO);
213 213

  
......
242 242
#if 0
243 243
            url_fseek(pb, size, SEEK_CUR);
244 244
#else
245
            if ((unsigned)size > sizeof(text) || (ret = get_buffer(pb, text, size)) != size)
245
            if ((unsigned)size > sizeof(text) || (ret = avio_read(pb, text, size)) != size)
246 246
                ret = AVERROR(EIO);
247 247
            else {
248 248
                int i = 0;

Also available in: Unified diff