From: Michael Niedermayer Date: Thu, 20 Jun 2013 22:32:00 +0000 (+0200) Subject: bytestream2_init: assert that buf_size is valid X-Git-Tag: android-x86-4.4-r1~2782 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c17dd513e7f15ef074e435119db7895837e6283a;p=android-x86%2Fexternal-ffmpeg.git bytestream2_init: assert that buf_size is valid Signed-off-by: Michael Niedermayer --- diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h index af7f75bd45..f2458591cb 100644 --- a/libavcodec/bytestream.h +++ b/libavcodec/bytestream.h @@ -26,6 +26,7 @@ #include #include +#include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/intreadwrite.h" @@ -131,6 +132,7 @@ static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size) { + av_assert0(buf_size >= 0); g->buffer = buf; g->buffer_start = buf; g->buffer_end = buf + buf_size; @@ -140,6 +142,7 @@ static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size) { + av_assert0(buf_size >= 0); p->buffer = buf; p->buffer_start = buf; p->buffer_end = buf + buf_size;