Revision e9b78eeb libavformat/wav.c

View differences:

libavformat/wav.c
188 188
        size = (size / st->codec->block_align) * st->codec->block_align;
189 189
    }
190 190
    size= FFMIN(size, left);
191
    if (av_new_packet(pkt, size))
191
    ret= av_get_packet(&s->pb, pkt, size);
192
    if (ret <= 0)
192 193
        return AVERROR_IO;
193 194
    pkt->stream_index = 0;
194 195

  
195
    ret = get_buffer(&s->pb, pkt->data, pkt->size);
196
    if (ret < 0)
197
        av_free_packet(pkt);
198 196
    /* note: we need to modify the packet size here to handle the last
199 197
       packet */
200 198
    pkt->size = ret;
......
235 233
    wav_read_packet,
236 234
    wav_read_close,
237 235
    wav_read_seek,
236
    .flags= AVFMT_GENERIC_INDEX,
238 237
    .codec_tag= (const AVCodecTag*[]){codec_wav_tags, 0},
239 238
};
240 239
#endif

Also available in: Unified diff