avcodec/h2645_parse: skip NALUs with no content after stripping all the trailing...
authorJames Almer <jamrial@gmail.com>
Mon, 14 May 2018 21:09:32 +0000 (18:09 -0300)
committerJames Almer <jamrial@gmail.com>
Mon, 14 May 2018 21:09:32 +0000 (18:09 -0300)
The GetBitContext is effectively empty in them.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/h2645_parse.c

index dbf2435..d436d65 100644 (file)
@@ -371,7 +371,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
             ret = hevc_parse_nal_header(nal, logctx);
         else
             ret = h264_parse_nal_header(nal, logctx);
-        if (ret <= 0 || nal->size <= 0) {
+        if (ret <= 0 || nal->size <= 0 || nal->size_bits <= 0) {
             if (ret < 0) {
                 av_log(logctx, AV_LOG_ERROR, "Invalid NAL unit %d, skipping.\n",
                        nal->type);