From 2272ab0e84de6ef29548e0c89bb041a5c2e55a18 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 4 Feb 2016 00:20:51 +0100 Subject: [PATCH] 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" Signed-off-by: Michael Niedermayer --- libavformat/mp3enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;