Revision ca402f32 libavformat/wav.c

View differences:

libavformat/wav.c
196 196
    AVIOContext *pb = s->pb;
197 197
    AVStream *st;
198 198
    WAVContext *wav = s->priv_data;
199
    int ret;
199 200

  
200 201
    /* check RIFF header */
201 202
    tag = avio_rl32(pb);
......
228 229
    if (!st)
229 230
        return AVERROR(ENOMEM);
230 231

  
231
    ff_get_wav_header(pb, st->codec, size);
232
    ret = ff_get_wav_header(pb, st->codec, size);
233
    if (ret < 0)
234
        return ret;
232 235
    st->need_parsing = AVSTREAM_PARSE_FULL;
233 236

  
234 237
    av_set_pts_info(st, 64, 1, st->codec->sample_rate);
......
384 387
    WAVContext    *wav = s->priv_data;
385 388
    AVStream *st;
386 389
    uint8_t guid[16];
390
    int ret;
387 391

  
388 392
    avio_read(pb, guid, 16);
389 393
    if (memcmp(guid, guid_riff, 16))
......
409 413
        return AVERROR(ENOMEM);
410 414

  
411 415
    /* subtract chunk header size - normal wav file doesn't count it */
412
    ff_get_wav_header(pb, st->codec, size - 24);
416
    ret = ff_get_wav_header(pb, st->codec, size - 24);
417
    if (ret < 0)
418
        return ret;
413 419
    avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
414 420

  
415 421
    st->need_parsing = AVSTREAM_PARSE_FULL;

Also available in: Unified diff