X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fadxdec.c;h=fe22c3ae697bb92a2306193c3c9e172ce426b53a;hb=8113e838a811cdeb1f73ed0f76b62d8504db50db;hp=0a0436f1847472bf9eb9c086a0e640aad3c99ce3;hpb=30aa9b727da05d9bf3346ffabdbc983bd5f37616;p=ffmpeg diff --git a/libavformat/adxdec.c b/libavformat/adxdec.c index 0a0436f1847..fe22c3ae697 100644 --- a/libavformat/adxdec.c +++ b/libavformat/adxdec.c @@ -78,13 +78,8 @@ static int adx_read_header(AVFormatContext *s) c->header_size = avio_rb16(s->pb) + 4; avio_seek(s->pb, -4, SEEK_CUR); - if (ff_alloc_extradata(avctx, c->header_size)) + if (ff_get_extradata(avctx, s->pb, c->header_size) < 0) return AVERROR(ENOMEM); - if (avio_read(s->pb, avctx->extradata, c->header_size) < c->header_size) { - av_freep(&avctx->extradata); - return AVERROR(EIO); - } - avctx->extradata_size = c->header_size; ret = avpriv_adx_decode_header(avctx, avctx->extradata, avctx->extradata_size, &c->header_size,