]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/h2645_parse: reset the H2645NAL type value before parsing a NAL header
authorJames Almer <jamrial@gmail.com>
Wed, 12 Aug 2020 18:03:52 +0000 (15:03 -0300)
committerJames Almer <jamrial@gmail.com>
Thu, 20 Aug 2020 16:50:11 +0000 (13:50 -0300)
This will prevent reporting a bogus value in the log message when
the header parsing fails.

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

index 7137af2ee48787d9e0323f50b066c26190170f78..0f98b49fbe2df6a46c726ae7485d0d6b60509fd0 100644 (file)
@@ -501,6 +501,9 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
         if (ret < 0)
             return ret;
 
+        /* Reset type in case it contains a stale value from a previously parsed NAL */
+        nal->type = 0;
+
         if (codec_id == AV_CODEC_ID_HEVC)
             ret = hevc_parse_nal_header(nal, logctx);
         else