Revision e356fc57 libavformat/cafdec.c

View differences:

libavformat/cafdec.c
114 114
            av_log(s, AV_LOG_ERROR, "invalid AAC magic cookie\n");
115 115
            return AVERROR_INVALIDDATA;
116 116
        }
117
        url_fskip(pb, skip);
117
        avio_seek(pb, skip, SEEK_CUR);
118 118
    } else if (st->codec->codec_id == CODEC_ID_ALAC) {
119 119
#define ALAC_PREAMBLE 12
120 120
#define ALAC_HEADER   36
121 121
        if (size < ALAC_PREAMBLE + ALAC_HEADER) {
122 122
            av_log(s, AV_LOG_ERROR, "invalid ALAC magic cookie\n");
123
            url_fskip(pb, size);
123
            avio_seek(pb, size, SEEK_CUR);
124 124
            return AVERROR_INVALIDDATA;
125 125
        }
126
        url_fskip(pb, ALAC_PREAMBLE);
126
        avio_seek(pb, ALAC_PREAMBLE, SEEK_CUR);
127 127
        st->codec->extradata = av_mallocz(ALAC_HEADER + FF_INPUT_BUFFER_PADDING_SIZE);
128 128
        if (!st->codec->extradata)
129 129
            return AVERROR(ENOMEM);
130 130
        avio_read(pb, st->codec->extradata, ALAC_HEADER);
131 131
        st->codec->extradata_size = ALAC_HEADER;
132
        url_fskip(pb, size - ALAC_PREAMBLE - ALAC_HEADER);
132
        avio_seek(pb, size - ALAC_PREAMBLE - ALAC_HEADER, SEEK_CUR);
133 133
    } else {
134 134
        st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
135 135
        if (!st->codec->extradata)
......
201 201
    int found_data, ret;
202 202
    int64_t size;
203 203

  
204
    url_fskip(pb, 8); /* magic, version, file flags */
204
    avio_seek(pb, 8, SEEK_CUR); /* magic, version, file flags */
205 205

  
206 206
    /* audio description chunk */
207 207
    if (avio_rb32(pb) != MKBETAG('d','e','s','c')) {
......
233 233

  
234 234
        switch (tag) {
235 235
        case MKBETAG('d','a','t','a'):
236
            url_fskip(pb, 4); /* edit count */
236
            avio_seek(pb, 4, SEEK_CUR); /* edit count */
237 237
            caf->data_start = url_ftell(pb);
238 238
            caf->data_size  = size < 0 ? -1 : size - 4;
239 239
            if (caf->data_size > 0 && !url_is_streamed(pb))
240
                url_fskip(pb, caf->data_size);
240
                avio_seek(pb, caf->data_size, SEEK_CUR);
241 241
            found_data = 1;
242 242
            break;
243 243

  
......
265 265
        case MKBETAG('f','r','e','e'):
266 266
            if (size < 0)
267 267
                return AVERROR_INVALIDDATA;
268
            url_fskip(pb, size);
268
            avio_seek(pb, size, SEEK_CUR);
269 269
            break;
270 270
        }
271 271
    }

Also available in: Unified diff