diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-01-01 16:47:27 +0100 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-01-01 16:47:27 +0100 |
commit | 1e96b151fa6e9931c626283b7dfc15e4ec0095aa (patch) | |
tree | d446814f822f9a3125c1b60414e1f9c68b6bdb64 /libavformat | |
parent | 15c60c8af2271cd7d5c6c6ce7f8f127a32f18cfd (diff) | |
parent | 955aec3c7c7be39b659197e1ec379a09f2b7c41c (diff) | |
download | ffmpeg-1e96b151fa6e9931c626283b7dfc15e4ec0095aa.tar.gz |
Merge commit '955aec3c7c7be39b659197e1ec379a09f2b7c41c'
* commit '955aec3c7c7be39b659197e1ec379a09f2b7c41c':
mpegaudiodecheader: check the header in avpriv_mpegaudio_decode_header
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mp3dec.c | 11 | ||||
-rw-r--r-- | libavformat/mp3enc.c | 5 |
2 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 95b70f7c29..8d41657058 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -82,9 +82,6 @@ static int mp3_read_probe(AVProbeData *p) for(; buf < end; buf= buf2+1) { buf2 = buf; - if(ff_mpa_check_header(AV_RB32(buf2))) - continue; - for(frames = 0; buf2 < end; frames++) { int dummy; header = AV_RB32(buf2); @@ -302,14 +299,16 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base) MPADecodeHeader c; int vbrtag_size = 0; MP3DecContext *mp3 = s->priv_data; + int ret; ffio_init_checksum(s->pb, ff_crcA001_update, 0); v = avio_rb32(s->pb); - if(ff_mpa_check_header(v) < 0) - return -1; - if (avpriv_mpegaudio_decode_header(&c, v) == 0) + ret = avpriv_mpegaudio_decode_header(&c, v); + if (ret < 0) + return ret; + else if (ret == 0) vbrtag_size = c.frame_size; if(c.layer != 3) return -1; diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index 40f0672507..7296234c20 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -309,12 +309,13 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt) if (pkt->data && pkt->size >= 4) { MPADecodeHeader mpah; + int ret; int av_unused base; uint32_t h; h = AV_RB32(pkt->data); - if (ff_mpa_check_header(h) == 0) { - avpriv_mpegaudio_decode_header(&mpah, h); + ret = avpriv_mpegaudio_decode_header(&mpah, h); + if (ret >= 0) { if (!mp3->initial_bitrate) mp3->initial_bitrate = mpah.bit_rate; if ((mpah.bit_rate == 0) || (mp3->initial_bitrate != mpah.bit_rate)) |