1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Michael Niedermayer 2016-02-04 00:20:51 +01:00
parent d12d48d0a8
commit 2272ab0e84

View File

@ -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;