]> git.sesse.net Git - ffmpeg/commit
avformat/wavdec: Fix reading files with id3v2 apic before fmt tag
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Fri, 16 Apr 2021 18:53:55 +0000 (20:53 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sun, 18 Apr 2021 00:49:43 +0000 (02:49 +0200)
commite1f41b4fdc5d3e8813d8f9d4d81899bd4e6df31b
tree60579319939655817bf778bb781afc53eb89fcf2
parenta74428921f8bfb33cbe0340bfd810b6945e432d2
avformat/wavdec: Fix reading files with id3v2 apic before fmt tag

Up until now the cover images will get the stream index 0 in this case,
violating the hardcoded assumption that this is the index of the audio
stream. Fix this by creating the audio stream first; this is also in
line with the expectations of ff_pcm_read_seek() and
ff_spdif_read_packet(). It also simplifies the code to parse the fmt and
xma2 tags.

Fixes #8540; regression since f5aad350d3695b5b16e7d135154a4c61e4dce9d8.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavformat/wavdec.c