diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-09 14:31:44 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-09 14:31:44 +0200 |
commit | 07108cafc6e8454ef5fd480936a06a59dd24b855 (patch) | |
tree | 78a2422145b4207fc0b0a11b7fc0b362e37b4f8c /libavformat | |
parent | eb336cb881b476288a9ee32bd397bd0a23ac74c2 (diff) | |
download | ffmpeg-07108cafc6e8454ef5fd480936a06a59dd24b855.tar.gz |
gxfenc: assert that the to be written data has not been truncated.
Otherwise out of array reads would happen later
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/gxfenc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 5d854c6926..70370a4162 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/avassert.h" #include "libavutil/intfloat.h" #include "libavutil/opt.h" #include "libavutil/mathematics.h" @@ -210,6 +211,7 @@ static int gxf_write_mpeg_auxiliary(AVIOContext *pb, AVStream *st) (float)st->codec->bit_rate, sc->p_per_gop, sc->b_per_i_or_p, st->codec->pix_fmt == PIX_FMT_YUV422P ? 2 : 1, sc->first_gop_closed == 1, starting_line, (st->codec->height + 15) / 16); + av_assert0(size < sizeof(buffer)); avio_w8(pb, TRACK_MPG_AUX); avio_w8(pb, size + 1); avio_write(pb, (uint8_t *)buffer, size + 1); |