diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c index c1066e1b3d..5e3b9b9874 100644 --- a/libavformat/wtvenc.c +++ b/libavformat/wtvenc.c @@ -298,7 +298,8 @@ static int write_stream_codec_info(AVFormatContext *s, AVStream *st) if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { put_videoinfoheader2(pb, st); } else { - ff_put_wav_header(pb, st->codec); + if (ff_put_wav_header(pb, st->codec) < 0) + format_type = &ff_format_none; } hdr_size = avio_tell(pb) - hdr_pos_start;