[FFmpeg-cvslog] oggenc: accept only STREAMINFO extradata
Anton Khirnov
git at videolan.org
Thu Nov 6 14:17:23 CET 2014
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Aug 28 18:51:51 2014 +0000| [e839de0f851535b5e19256b52f9865f0cb768a7c] | committer: Anton Khirnov
oggenc: accept only STREAMINFO extradata
The reasoning is the same as for
0097cbea695e534fce39958ccd103af2fbf65831.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e839de0f851535b5e19256b52f9865f0cb768a7c
---
libavformat/oggenc.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 8f08da1..c7d6491 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -295,12 +295,10 @@ static int ogg_build_flac_headers(AVCodecContext *avctx,
OGGStreamContext *oggstream, int bitexact,
AVDictionary **m)
{
- enum FLACExtradataFormat format;
- uint8_t *streaminfo;
uint8_t *p;
- if (!avpriv_flac_is_extradata_valid(avctx, &format, &streaminfo))
- return -1;
+ if (avctx->extradata_size < FLAC_STREAMINFO_SIZE)
+ return AVERROR(EINVAL);
// first packet: STREAMINFO
oggstream->header_len[0] = 51;
@@ -316,7 +314,7 @@ static int ogg_build_flac_headers(AVCodecContext *avctx,
bytestream_put_buffer(&p, "fLaC", 4);
bytestream_put_byte(&p, 0x00); // streaminfo
bytestream_put_be24(&p, 34);
- bytestream_put_buffer(&p, streaminfo, FLAC_STREAMINFO_SIZE);
+ bytestream_put_buffer(&p, avctx->extradata, FLAC_STREAMINFO_SIZE);
// second packet: VorbisComment
p = ogg_write_vorbiscomment(4, bitexact, &oggstream->header_len[1], m, 0);
More information about the ffmpeg-cvslog
mailing list