[libav-commits] mp3enc: fix a triggerable assert

Anton Khirnov git at libav.org
Sat Nov 15 08:54:34 CET 2014

Module: libav
Branch: release/9
Commit: ce424e57d629072652935501b439c1a6310c2089

Author:    Anton Khirnov <anton at khirnov.net>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Fri Nov 14 20:20:50 2014 +0100

mp3enc: fix a triggerable assert

We have to check against the number of bytes actually needed, not the
theoretical maximum size.

(cherry picked from commit 12700b0219521a5f20c8ba47b3ad7857ea9e0554)
Signed-off-by: Anton Khirnov <anton at khirnov.net>
(cherry picked from commit 871d99ef77336069e5a8ece947c8160d9bc4d5ea)
Signed-off-by: Anton Khirnov <anton at khirnov.net>


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

diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index 631705c..0596d60 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -195,7 +195,7 @@ static void mp3_write_xing(AVFormatContext *s)
     avpriv_mpegaudio_decode_header(&mpah, header);
-    av_assert0(mpah.frame_size >= XING_MAX_SIZE);
+    av_assert0(mpah.frame_size >= bytes_needed);
     ffio_fill(s->pb, 0, xing_offset);
     mp3->xing_offset = avio_tell(s->pb);

More information about the libav-commits mailing list