From fed02825081bd6441f865c9cfcf50e384b2392f5 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 24 Aug 2021 14:58:07 +0200 Subject: avformat: Avoid allocation for AVFormatInternal Do this by allocating AVFormatContext together with the data that is currently in AVFormatInternal; or rather: Put AVFormatContext at the beginning of a new structure called FFFormatContext (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVFormatInternal altogether. The biggest simplifications occured in avformat_alloc_context(), where one can now simply call avformat_free_context() in case of errors. Signed-off-by: Andreas Rheinhardt --- libavformat/wavdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat/wavdec.c') diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 30c9ac37f8..815d189671 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -549,7 +549,7 @@ static int wav_read_header(AVFormatContext *s) case MKTAG('I', 'D', '3', ' '): case MKTAG('i', 'd', '3', ' '): { ID3v2ExtraMeta *id3v2_extra_meta; - ff_id3v2_read_dict(pb, &s->internal->id3v2_meta, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta); + ff_id3v2_read_dict(pb, &ffformatcontext(s)->id3v2_meta, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta); if (id3v2_extra_meta) { ff_id3v2_parse_apic(s, id3v2_extra_meta); ff_id3v2_parse_chapters(s, id3v2_extra_meta); -- cgit v1.2.3