OSDN Git Service
(root)
/
coroid
/
libav_saccubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68ca330
)
indeo2: fail if input buffer too small
author
Alex Converse
<alex.converse@gmail.com>
Fri, 9 Sep 2011 20:26:49 +0000
(13:26 -0700)
committer
Alex Converse
<alex.converse@gmail.com>
Fri, 9 Sep 2011 22:01:00 +0000
(15:01 -0700)
libavcodec/indeo2.c
patch
|
blob
|
history
diff --git
a/libavcodec/indeo2.c
b/libavcodec/indeo2.c
index
591c1ce
..
398a9ac
100644
(file)
--- a/
libavcodec/indeo2.c
+++ b/
libavcodec/indeo2.c
@@
-156,6
+156,13
@@
static int ir2_decode_frame(AVCodecContext *avctx,
return -1;
}
+ start = 48; /* hardcoded for now */
+
+ if (start >= buf_size) {
+ av_log(s->avctx, AV_LOG_ERROR, "input buffer size too small (%d)\n", buf_size);
+ return AVERROR_INVALIDDATA;
+ }
+
s->decode_delta = buf[18];
/* decide whether frame uses deltas or not */
@@
-163,7
+170,6
@@
static int ir2_decode_frame(AVCodecContext *avctx,
for (i = 0; i < buf_size; i++)
buf[i] = av_reverse[buf[i]];
#endif
- start = 48; /* hardcoded for now */
init_get_bits(&s->gb, buf + start, (buf_size - start) * 8);