git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4809781
)
flv: Validate the packet size
author
Luca Barbato
<lu_zero@gentoo.org>
Mon, 17 Apr 2017 14:10:52 +0000
(14:10 +0000)
committer
Luca Barbato
<lu_zero@gentoo.org>
Thu, 20 Apr 2017 15:39:18 +0000
(15:39 +0000)
Size can be negative at that point.
Bug-Id: 1041
CC: libav-stable@libav.org
libavformat/flvdec.c
patch
|
blob
|
history
diff --git
a/libavformat/flvdec.c
b/libavformat/flvdec.c
index
693c859
..
1b29740
100644
(file)
--- a/
libavformat/flvdec.c
+++ b/
libavformat/flvdec.c
@@
-912,6
+912,12
@@
skip:
st->codecpar->codec_id == AV_CODEC_ID_H264) {
int type = avio_r8(s->pb);
size--;
+
+ if (size < 0) {
+ ret = AVERROR_INVALIDDATA;
+ goto leave;
+ }
+
if (st->codecpar->codec_id == AV_CODEC_ID_H264) {
// sign extension
int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000;