aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-05-14 18:09:32 -0300
committerAman Gupta <aman@tmm1.net>2018-10-11 22:31:17 -0700
commit967604fecf042ff11474315538d3258c8f7b49b2 (patch)
tree894aa2a20d7ce5bb03550aca8afce06cf5e70e0c
parent3fb09dba40b0d0a67272af8f7995638eaea3f9a4 (diff)
downloadffmpeg-967604fecf042ff11474315538d3258c8f7b49b2.tar.gz
avcodec/h2645_parse: skip NALUs with no content after stripping all the trailing zeros
The GetBitContext is effectively empty in them. Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 9a09f4c54ab829811c2dd041cfb7196000590b78)
-rw-r--r--libavcodec/h2645_parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index e6c40381b0..f35c02d1bd 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -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);