aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-02-28 20:58:31 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-06-10 02:13:09 +0200
commit3bfaadfadaba9a1035f87d276d3a0ab64d571cb5 (patch)
tree6875f75c0cb5b347f9acd85b624dfb86e4b787b6
parent852ef62b85c04eb37dbe337ff0d8a59d459a7d29 (diff)
downloadffmpeg-3bfaadfadaba9a1035f87d276d3a0ab64d571cb5.tar.gz
avformat/flvenc: check that the codec_tag fits in the available bits
flags is later written with avio_w8 and if it doesn't fit in one byte it triggers an av_assert2. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit e8565d21c276ab9ac5ce785549420321fbd0b093) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/flvenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 9d5522e9bc..8ff964c31b 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -485,7 +485,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
avio_w8(pb, FLV_TAG_TYPE_VIDEO);
flags = enc->codec_tag;
- if (flags == 0) {
+ if (flags <= 0 || flags > 15) {
av_log(s, AV_LOG_ERROR,
"Video codec '%s' is not compatible with FLV\n",
avcodec_get_name(enc->codec_id));