[FFmpeg-devel] [PATCH] avformat/iff: ignore FVER tag when not processing DSD/DST files
Peter Ross
pross at xvid.org
Sat Dec 28 12:31:42 EET 2024
Fixes ticket #10030.
---
libavformat/iff.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/libavformat/iff.c b/libavformat/iff.c
index ab0488dd31..19420c21a2 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -692,13 +692,15 @@ static int iff_read_header(AVFormatContext *s)
/* DSD tags */
case MKTAG('F','V','E','R'):
- if (data_size < 4)
- return AVERROR_INVALIDDATA;
- version = avio_rb32(pb);
- av_log(s, AV_LOG_DEBUG, "DSIFF v%d.%d.%d.%d\n",version >> 24, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
- if (!new_stream(s, &sta, &iff->audio_stream_index, AVMEDIA_TYPE_AUDIO))
- return AVERROR(ENOMEM);
- sta->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+ if (iff->form_tag == ID_DSD || iff->form_tag == ID_DST) {
+ if (data_size < 4)
+ return AVERROR_INVALIDDATA;
+ version = avio_rb32(pb);
+ av_log(s, AV_LOG_DEBUG, "DSIFF v%d.%d.%d.%d\n",version >> 24, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
+ if (!new_stream(s, &sta, &iff->audio_stream_index, AVMEDIA_TYPE_AUDIO))
+ return AVERROR(ENOMEM);
+ sta->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+ }
break;
case MKTAG('D','I','I','N'):
--
2.45.2
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241228/5857a6d2/attachment.sig>
More information about the ffmpeg-devel
mailing list