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:
20182e7
)
avcodec/dvdsubdec: Fix buf_size check
author
Michael Niedermayer
<michael@niedermayer.cc>
Wed, 26 Oct 2016 14:29:57 +0000
(16:29 +0200)
committer
Michael Niedermayer
<michael@niedermayer.cc>
Wed, 26 Oct 2016 16:46:10 +0000
(18:46 +0200)
Fixes out of array access
Found-by: Thomas Garnier using libFuzzer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/dvdsubdec.c
patch
|
blob
|
history
diff --git
a/libavcodec/dvdsubdec.c
b/libavcodec/dvdsubdec.c
index
b81b481
..
6cb612b
100644
(file)
--- a/
libavcodec/dvdsubdec.c
+++ b/
libavcodec/dvdsubdec.c
@@
-548,7
+548,8
@@
static int append_to_cached_buf(AVCodecContext *avctx,
{
DVDSubContext *ctx = avctx->priv_data;
- if (ctx->buf_size >= sizeof(ctx->buf) - buf_size) {
+ av_assert0(buf_size >= 0 && ctx->buf_size <= sizeof(ctx->buf));
+ if (buf_size >= sizeof(ctx->buf) - ctx->buf_size) {
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
"too large SPU packets aborted.\n");
ctx->buf_size = 0;