Merge commit 'e839de0f851535b5e19256b52f9865f0cb768a7c'
* commit 'e839de0f851535b5e19256b52f9865f0cb768a7c': oggenc: accept only STREAMINFO extradata Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
94fe404c25
@ -307,12 +307,10 @@ static int ogg_build_flac_headers(AVCodecContext *avctx,
|
|||||||
OGGStreamContext *oggstream, int bitexact,
|
OGGStreamContext *oggstream, int bitexact,
|
||||||
AVDictionary **m)
|
AVDictionary **m)
|
||||||
{
|
{
|
||||||
enum FLACExtradataFormat format;
|
|
||||||
uint8_t *streaminfo;
|
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
|
|
||||||
if (!avpriv_flac_is_extradata_valid(avctx, &format, &streaminfo))
|
if (avctx->extradata_size < FLAC_STREAMINFO_SIZE)
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
// first packet: STREAMINFO
|
// first packet: STREAMINFO
|
||||||
oggstream->header_len[0] = 51;
|
oggstream->header_len[0] = 51;
|
||||||
@ -328,7 +326,7 @@ static int ogg_build_flac_headers(AVCodecContext *avctx,
|
|||||||
bytestream_put_buffer(&p, "fLaC", 4);
|
bytestream_put_buffer(&p, "fLaC", 4);
|
||||||
bytestream_put_byte(&p, 0x00); // streaminfo
|
bytestream_put_byte(&p, 0x00); // streaminfo
|
||||||
bytestream_put_be24(&p, 34);
|
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
|
// second packet: VorbisComment
|
||||||
p = ogg_write_vorbiscomment(4, bitexact, &oggstream->header_len[1], m, 0);
|
p = ogg_write_vorbiscomment(4, bitexact, &oggstream->header_len[1], m, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user