summaryrefslogtreecommitdiffstats
path: root/libavcodec/h2645_parse.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-05-07 16:28:39 +0200
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-05-07 21:14:23 +0100
commitd46e85635070fd2c4cd7cd4b97720e5868c1bfc1 (patch)
tree9cfcd22dad33bfe2f77b9726c72d38b40f2ee7d1 /libavcodec/h2645_parse.c
parentd6f92103e0f6696923a42f2c1fdc9fe4b877e7b8 (diff)
downloadffmpeg-streaming-d46e85635070fd2c4cd7cd4b97720e5868c1bfc1.zip
ffmpeg-streaming-d46e85635070fd2c4cd7cd4b97720e5868c1bfc1.tar.gz
h265_parse: skip zero sized NAL units
Avoids extra error checks later on and/or invalid reads. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@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 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);
OpenPOWER on IntegriCloud