]> git.sesse.net Git - ffmpeg/commitdiff
avformat/hlsenc: Fix check for SPS
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 20 Oct 2020 11:00:04 +0000 (13:00 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 20 Oct 2020 11:00:04 +0000 (13:00 +0200)
Check all the six bits, not only the two bits that are set for SPS.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/hlsenc.c

index 4967247bcaec68f19e3bf67dedbe5e7863690e47..cbfd8f7c0d41adfe08e7f451a1aa2ac14cee4609 100644 (file)
@@ -351,7 +351,7 @@ static void write_codec_attr(AVStream *st, VariantStream *vs)
         /* check the boundary of data which from current position is small than extradata_size */
         while (data && (data - st->codecpar->extradata + 19) < st->codecpar->extradata_size) {
             /* get HEVC SPS NAL and seek to profile_tier_level */
-            if (!(data[0] | data[1] | data[2]) && data[3] == 1 && ((data[4] & 0x42) == 0x42)) {
+            if (!(data[0] | data[1] | data[2]) && data[3] == 1 && ((data[4] & 0x7E) == 0x42)) {
                 uint8_t *rbsp_buf;
                 int remain_size = 0;
                 int rbsp_size = 0;