]> git.sesse.net Git - ffmpeg/commitdiff
lavf/mpegtsenc: fix logic check error
authorJun Zhao <barryjzhao@tencent.com>
Sat, 15 Jun 2019 08:19:18 +0000 (16:19 +0800)
committerJun Zhao <barryjzhao@tencent.com>
Mon, 4 Nov 2019 02:22:11 +0000 (10:22 +0800)
fix the logic check error

fix #6751

Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
libavformat/mpegtsenc.c

index 0678657d094cf34ef81138416791a6a0266d28db..9f8f1715c9f371f359f5c63b8a070c19e332729c 100644 (file)
@@ -1642,7 +1642,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
         } while (p < buf_end && (state & 0x7e) != 2*35 &&
                  (state & 0x7e) >= 2*32);
 
-        if ((state & 0x7e) < 2*16 && (state & 0x7e) >= 2*24)
+        if ((state & 0x7e) < 2*16 || (state & 0x7e) >= 2*24)
             extradd = 0;
         if ((state & 0x7e) != 2*35) { // AUD NAL
             data = av_malloc(pkt->size + 7 + extradd);