summaryrefslogtreecommitdiff
path: root/libavcodec/libmp3lame.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-01-01 16:47:27 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2016-01-01 16:47:27 +0100
commit1e96b151fa6e9931c626283b7dfc15e4ec0095aa (patch)
treed446814f822f9a3125c1b60414e1f9c68b6bdb64 /libavcodec/libmp3lame.c
parent15c60c8af2271cd7d5c6c6ce7f8f127a32f18cfd (diff)
parent955aec3c7c7be39b659197e1ec379a09f2b7c41c (diff)
downloadffmpeg-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 'libavcodec/libmp3lame.c')
-rw-r--r--libavcodec/libmp3lame.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 873b390c0c..5642264a4a 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -246,11 +246,12 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if (s->buffer_index < 4)
return 0;
h = AV_RB32(s->buffer);
- if (ff_mpa_check_header(h) < 0) {
+
+ ret = avpriv_mpegaudio_decode_header(&hdr, h);
+ if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid mp3 header at start of buffer\n");
return AVERROR_BUG;
- }
- if (avpriv_mpegaudio_decode_header(&hdr, h)) {
+ } else if (ret) {
av_log(avctx, AV_LOG_ERROR, "free format output not supported\n");
return -1;
}