]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/hevc_parse.c
Merge commit '2f4a1bb9bfb29112711ba904e1dc0dd58e24f361'
[ffmpeg] / libavcodec / hevc_parse.c
index 63ed84a8de78bb963da247ee3837d34540f13cf4..d557cc7f04c5ae573e354729d3d1b62c53856eab 100644 (file)
@@ -232,8 +232,14 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
                 ++buf;
                 --length;
                 if (length < 4) {
-                    av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
-                    return AVERROR_INVALIDDATA;
+                    if (pkt->nb_nals > 0) {
+                        // No more start codes: we discarded some irrelevant
+                        // bytes at the end of the packet.
+                        return 0;
+                    } else {
+                        av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
+                        return AVERROR_INVALIDDATA;
+                    }
                 }
             }