OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32fc8d6
)
bytestream2_init: assert that buf_size is valid
author
Michael Niedermayer
<michaelni@gmx.at>
Thu, 20 Jun 2013 22:32:00 +0000
(
00:32
+0200)
committer
Michael Niedermayer
<michaelni@gmx.at>
Thu, 20 Jun 2013 22:58:41 +0000
(
00:58
+0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/bytestream.h
patch
|
blob
|
history
diff --git
a/libavcodec/bytestream.h
b/libavcodec/bytestream.h
index
af7f75b
..
f245859
100644
(file)
--- a/
libavcodec/bytestream.h
+++ b/
libavcodec/bytestream.h
@@
-26,6
+26,7
@@
#include <stdint.h>
#include <string.h>
+#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;