Revision e63a3628 libavformat/mm.c

View differences:

libavformat/mm.c
90 90
    unsigned int type, length;
91 91
    unsigned int frame_rate, width, height;
92 92

  
93
    type = get_le16(pb);
94
    length = get_le32(pb);
93
    type = avio_rl16(pb);
94
    length = avio_rl32(pb);
95 95

  
96 96
    if (type != MM_TYPE_HEADER)
97 97
        return AVERROR_INVALIDDATA;
98 98

  
99 99
    /* read header */
100
    get_le16(pb);   /* total number of chunks */
101
    frame_rate = get_le16(pb);
102
    get_le16(pb);   /* ibm-pc video bios mode */
103
    width = get_le16(pb);
104
    height = get_le16(pb);
100
    avio_rl16(pb);   /* total number of chunks */
101
    frame_rate = avio_rl16(pb);
102
    avio_rl16(pb);   /* ibm-pc video bios mode */
103
    width = avio_rl16(pb);
104
    height = avio_rl16(pb);
105 105
    url_fseek(pb, length - 10, SEEK_CUR);  /* unknown data */
106 106

  
107 107
    /* video stream */
......
143 143

  
144 144
    while(1) {
145 145

  
146
        if (get_buffer(pb, preamble, MM_PREAMBLE_SIZE) != MM_PREAMBLE_SIZE) {
146
        if (avio_read(pb, preamble, MM_PREAMBLE_SIZE) != MM_PREAMBLE_SIZE) {
147 147
            return AVERROR(EIO);
148 148
        }
149 149

  
......
162 162
            if (av_new_packet(pkt, length + MM_PREAMBLE_SIZE))
163 163
                return AVERROR(ENOMEM);
164 164
            memcpy(pkt->data, preamble, MM_PREAMBLE_SIZE);
165
            if (get_buffer(pb, pkt->data + MM_PREAMBLE_SIZE, length) != length)
165
            if (avio_read(pb, pkt->data + MM_PREAMBLE_SIZE, length) != length)
166 166
                return AVERROR(EIO);
167 167
            pkt->size = length + MM_PREAMBLE_SIZE;
168 168
            pkt->stream_index = 0;

Also available in: Unified diff