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:
1713eec
)
truemotion1: check the header size
author
Anton Khirnov
<anton@khirnov.net>
Thu, 28 Nov 2013 09:54:35 +0000
(10:54 +0100)
committer
Anton Khirnov
<anton@khirnov.net>
Tue, 4 Feb 2014 21:00:13 +0000
(22:00 +0100)
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
libavcodec/truemotion1.c
patch
|
blob
|
history
diff --git
a/libavcodec/truemotion1.c
b/libavcodec/truemotion1.c
index
b1497d5
..
270a030
100644
(file)
--- a/
libavcodec/truemotion1.c
+++ b/
libavcodec/truemotion1.c
@@
-323,6
+323,11
@@
static int truemotion1_decode_header(TrueMotion1Context *s)
return AVERROR_INVALIDDATA;
}
+ if (header.header_size + 1 > s->size) {
+ av_log(s->avctx, AV_LOG_ERROR, "Input packet too small.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
/* unscramble the header bytes with a XOR operation */
for (i = 1; i < header.header_size; i++)
header_buffer[i - 1] = s->buf[i] ^ s->buf[i + 1];