diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-01 14:02:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-01 14:12:04 +0200 |
commit | 855e3b5700fff78bf20f900daade58396b73846d (patch) | |
tree | bb9cb11b8c16cd37154c10f3b500ab3618627bfa | |
parent | 05c5dd403d6a6974eb0a0688fcd22fe0417c2d84 (diff) | |
parent | 0097cbea695e534fce39958ccd103af2fbf65831 (diff) | |
download | ffmpeg-855e3b5700fff78bf20f900daade58396b73846d.tar.gz |
Merge commit '0097cbea695e534fce39958ccd103af2fbf65831'
* commit '0097cbea695e534fce39958ccd103af2fbf65831':
flac muxer: accept only STREAMINFO extradata
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/flacenc_header.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavformat/flacenc_header.c b/libavformat/flacenc_header.c index 4dd89b1903..3fb28c9e3b 100644 --- a/libavformat/flacenc_header.c +++ b/libavformat/flacenc_header.c @@ -22,7 +22,7 @@ #include "libavutil/channel_layout.h" #include "libavcodec/flac.h" -#include "libavcodec/bytestream.h" + #include "avformat.h" #include "flacenc.h" @@ -32,18 +32,17 @@ int ff_flac_write_header(AVIOContext *pb, AVCodecContext *codec, uint8_t header[8] = { 0x66, 0x4C, 0x61, 0x43, 0x00, 0x00, 0x00, 0x22 }; - uint8_t *streaminfo; - enum FLACExtradataFormat format; header[4] = last_block ? 0x80 : 0x00; - if (!avpriv_flac_is_extradata_valid(codec, &format, &streaminfo)) - return -1; + + if (codec->extradata_size < FLAC_STREAMINFO_SIZE) + return AVERROR_INVALIDDATA; /* write "fLaC" stream marker and first metadata block header */ avio_write(pb, header, 8); /* write STREAMINFO */ - avio_write(pb, streaminfo, FLAC_STREAMINFO_SIZE); + avio_write(pb, codec->extradata, FLAC_STREAMINFO_SIZE); return 0; } |