diff mbox series

[FFmpeg-devel,3/3] avcodec/h2645_parse: reset the H2645NAL type value before parsing a NAL header

Message ID 20200812182558.14199-3-jamrial@gmail.com
State Accepted
Commit 23bbb01077b6e1f623238173be547425159b33bd
Headers show
Series [FFmpeg-devel,1/3] avcodec/h2645_parse: always return 0 on successful h{264, evc}_parse_nal_header() calls | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

James Almer Aug. 12, 2020, 6:25 p.m. UTC
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 | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index 5708fe56f9..162272a6de 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -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