[FFmpeg-devel] [PATCH] lavf/wavenc: check for a single stream.

Nicolas George george at nsup.org
Sat Nov 2 16:30:38 CET 2013


Fix trac ticket #3110.

Signed-off-by: Nicolas George <george at nsup.org>
---
 libavformat/wavenc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index fea38cf..0067dfe 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -116,6 +116,11 @@ static int wav_write_header(AVFormatContext *s)
     AVIOContext *pb = s->pb;
     int64_t fmt;
 
+    if (s->nb_streams != 1) {
+        av_log(s, AV_LOG_ERROR, "WAVE files have exactly one stream\n");
+        return AVERROR(EINVAL);
+    }
+
     if (wav->rf64 == RF64_ALWAYS) {
         ffio_wfourcc(pb, "RF64");
         avio_wl32(pb, -1); /* RF64 chunk size: use size in ds64 */
-- 
1.8.4.rc3



More information about the ffmpeg-devel mailing list