[FFmpeg-cvslog] h265_parse: skip zero sized NAL units

Hendrik Leppkes git at videolan.org
Sat May 7 22:22:53 CEST 2016


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Sat May  7 16:28:39 2016 +0200| [d46e85635070fd2c4cd7cd4b97720e5868c1bfc1] | committer: Derek Buitenhuis

h265_parse: skip zero sized NAL units

Avoids extra error checks later on and/or invalid reads.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>

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

 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 aac9f99..62d0447 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -333,7 +333,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) {
+        if (ret <= 0 || nal->size <= 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