Size can be negative at that point.
Bug-Id: 1041
CC: [email protected]
---
libavformat/flvdec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 693c859ebf..1b29740f41 100644
--- 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;
--
2.11.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel