summaryrefslogtreecommitdiff
path: root/libavformat/mp3enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-02-04 00:20:51 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-02-07 01:12:48 +0100
commit2272ab0e84de6ef29548e0c89bb041a5c2e55a18 (patch)
tree32f0f019bdb03c14977dcead13ae78a33ba91db6 /libavformat/mp3enc.c
parentd12d48d0a8e188feecdfc9b792f54f0892ef6696 (diff)
downloadffmpeg-2272ab0e84de6ef29548e0c89bb041a5c2e55a18.tar.gz
avformat/mp3enc: Assert that the header we assembled is valid
Silences: CID1351343 The header is calculated by the code above the changed hunk, it is thus asserted that the header is always correct. Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mp3enc.c')
-rw-r--r--libavformat/mp3enc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index 7296234c20..71f5178a50 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -192,7 +192,8 @@ static int mp3_write_xing(AVFormatContext *s)
return -1;
header |= mask;
- avpriv_mpegaudio_decode_header(&mpah, header);
+ ret = avpriv_mpegaudio_decode_header(&mpah, header);
+ av_assert0(ret >= 0);
mp3->xing_offset = xing_offtbl[mpah.lsf == 1][mpah.nb_channels == 1] + 4;
bytes_needed = mp3->xing_offset + XING_SIZE;