summaryrefslogtreecommitdiff
path: root/libavformat/mp3enc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-10-09 15:16:46 +0200
committerAnton Khirnov <anton@khirnov.net>2015-12-12 21:25:42 +0100
commit955aec3c7c7be39b659197e1ec379a09f2b7c41c (patch)
tree492417dfa6f76fc48144e966f762c4176e6a4706 /libavformat/mp3enc.c
parentcea1eef25c3310a68dd327eb74aae14ad3c2ddef (diff)
mpegaudiodecheader: check the header in avpriv_mpegaudio_decode_header
Almost all the places from which this function is called already check the header manually and in the two that don't (the mp3 muxer) the check should not cause any problems.
Diffstat (limited to 'libavformat/mp3enc.c')
-rw-r--r--libavformat/mp3enc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index e4c6dbb223..42b3296512 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -306,11 +306,12 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)
if (mp3->xing_offset && pkt->size >= 4) {
MPADecodeHeader c;
+ int ret;
uint32_t h;
h = AV_RB32(pkt->data);
- if (ff_mpa_check_header(h) == 0) {
- avpriv_mpegaudio_decode_header(&c, h);
+ ret = avpriv_mpegaudio_decode_header(&c, h);
+ if (ret >= 0) {
if (!mp3->initial_bitrate)
mp3->initial_bitrate = c.bit_rate;
if ((c.bit_rate == 0) || (mp3->initial_bitrate != c.bit_rate))