---
 libavformat/mpegtsenc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 8232cbc..bbe3085 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -954,7 +954,8 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket 
*pkt)
         const uint8_t *p = buf, *buf_end = p+size;
         uint32_t state = -1;
 
-        if (pkt->size < 5 || AV_RB32(pkt->data) != 0x0000001) {
+        if (pkt->size < 5 || (AV_RB32(pkt->data) != 0x0000001 &&
+                              AV_RB24(pkt->data) != 0x0000001)) {
             av_log(s, AV_LOG_ERROR, "H.264 bitstream malformed, "
                    "no startcode found, use -bsf h264_mp4toannexb\n");
             return -1;
-- 
1.7.3.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to