diff options
Diffstat (limited to 'libavformat/cafdec.c')
-rw-r--r-- | libavformat/cafdec.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index 85356ec439..d0f942f3e4 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -135,7 +135,6 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size) return AVERROR_INVALIDDATA; } - av_freep(&st->codecpar->extradata); if ((ret = ff_alloc_extradata(st->codecpar, ALAC_HEADER)) < 0) return ret; @@ -175,10 +174,8 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size) return AVERROR_PATCHWELCOME; } avio_skip(pb, size); - } else { - av_freep(&st->codecpar->extradata); - if ((ret = ff_get_extradata(s, st->codecpar, pb, size)) < 0) - return ret; + } else if ((ret = ff_get_extradata(s, st->codecpar, pb, size)) < 0) { + return ret; } return 0; |