summaryrefslogtreecommitdiff
path: root/libavformat/mp3dec.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/mp3dec.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/mp3dec.c')
-rw-r--r--libavformat/mp3dec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index a875b82c0a..8904797491 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -275,14 +275,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;
@@ -388,8 +390,8 @@ static int check(AVIOContext *pb, int64_t pos, int64_t *out_pos)
header = avio_rb32(pb);
- if (ff_mpa_check_header(header) < 0 ||
- avpriv_mpegaudio_decode_header(&mh, header))
+
+ if (avpriv_mpegaudio_decode_header(&mh, header))
break;
out_pos[i] = off;
}