[FFmpeg-cvslog] avformat/mp3enc: Assert that the header we assembled is valid

Michael Niedermayer git at videolan.org
Sun Feb 7 01:14:04 CET 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Feb  4 00:20:51 2016 +0100| [2272ab0e84de6ef29548e0c89bb041a5c2e55a18] | committer: Michael Niedermayer

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 at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2272ab0e84de6ef29548e0c89bb041a5c2e55a18
---

 libavformat/mp3enc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index 7296234..71f5178 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;
 



More information about the ffmpeg-cvslog mailing list