[FFmpeg-devel] [PATCH V1 1/3] lavf/mpegtsenc: fix logic check error

Jun Zhao mypopydev at gmail.com
Sat Jun 15 20:13:36 EEST 2019


From: Jun Zhao <barryjzhao at tencent.com>

fix the logic check error

Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
---
 libavformat/mpegtsenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index fc0ea22..5d679c9 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1651,7 +1651,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);
-- 
1.7.1



More information about the ffmpeg-devel mailing list