[FFmpeg-cvslog] avcodec/h2645_parse: skip NALUs with no content after stripping all the trailing zeros

James Almer git at videolan.org
Tue May 15 00:12:00 EEST 2018


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon May 14 18:09:32 2018 -0300| [9a09f4c54ab829811c2dd041cfb7196000590b78] | committer: James Almer

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 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a09f4c54ab829811c2dd041cfb7196000590b78
---

 libavcodec/h2645_parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);



More information about the ffmpeg-cvslog mailing list