[FFmpeg-cvslog] avformat/flvenc: check that the codec_tag fits in the available bits

Andreas Cadhalpun git at videolan.org
Sun Mar 29 03:41:16 CEST 2015


ffmpeg | branch: release/2.4 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Sat Feb 28 20:58:31 2015 +0100| [a80b38d7d24863a8275d73cc4e041761ce5257cc] | committer: Michael Niedermayer

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 at gmx.at>
(cherry picked from commit e8565d21c276ab9ac5ce785549420321fbd0b093)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a80b38d7d24863a8275d73cc4e041761ce5257cc
---

 libavformat/flvenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index febc5e5..857f3fb 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -489,7 +489,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));



More information about the ffmpeg-cvslog mailing list