X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fapetag.c;h=6e59bc7de188ba59972dc4c50ccf37a0149ef05f;hb=85b424a45e3846bf48b8e53bc107bb4ead8216c6;hp=a376a0bc4a4db1db8b46005d1615d13a7f1a5a45;hpb=30aa9b727da05d9bf3346ffabdbc983bd5f37616;p=ffmpeg diff --git a/libavformat/apetag.c b/libavformat/apetag.c index a376a0bc4a4..6e59bc7de18 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -88,13 +88,8 @@ static int ape_tag_read_field(AVFormatContext *s) st->attached_pic.stream_index = st->index; st->attached_pic.flags |= AV_PKT_FLAG_KEY; } else { - if (ff_alloc_extradata(st->codec, size)) + if (ff_get_extradata(st->codec, s->pb, size) < 0) return AVERROR(ENOMEM); - if (avio_read(pb, st->codec->extradata, size) != size) { - av_freep(&st->codec->extradata); - st->codec->extradata_size = 0; - return AVERROR(EIO); - } st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT; } } else {