projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e02b38
)
get_bits: change the failure condition in init_get_bits
author
Luca Barbato
<lu_zero@gentoo.org>
Sun, 20 Jan 2013 04:10:32 +0000
(
05:10
+0100)
committer
Luca Barbato
<lu_zero@gentoo.org>
Sun, 20 Jan 2013 12:37:56 +0000
(13:37 +0100)
Too much code relies in having init_get_bits fed with a valid
buffer and set its dimension to 0.
Check for NULL buffer instead.
libavcodec/get_bits.h
patch
|
blob
|
history
diff --git
a/libavcodec/get_bits.h
b/libavcodec/get_bits.h
index
12770a2
..
ffa0656
100644
(file)
--- a/
libavcodec/get_bits.h
+++ b/
libavcodec/get_bits.h
@@
-375,7
+375,7
@@
static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
int buffer_size;
int ret = 0;
- if (bit_size > INT_MAX - 7 || bit_size <
= 0
) {
+ if (bit_size > INT_MAX - 7 || bit_size <
0 || !buffer
) {
buffer_size = bit_size = 0;
buffer = NULL;
ret = AVERROR_INVALIDDATA;