summaryrefslogtreecommitdiff
path: root/libavcodec/h2645_parse.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-05-14 18:09:32 -0300
committerJames Almer <jamrial@gmail.com>2018-05-14 18:09:32 -0300
commit9a09f4c54ab829811c2dd041cfb7196000590b78 (patch)
treeffd759e706b5300bc349e5164ce54dc0047b98e9 /libavcodec/h2645_parse.c
parent20b88076223b88f99e44b6ac5d68749c8d6998ca (diff)
downloadffmpeg-9a09f4c54ab829811c2dd041cfb7196000590b78.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>
Diffstat (limited to 'libavcodec/h2645_parse.c')
-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 dbf2435677..d436d65f48 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);