Skip to content

Commit

Permalink
h265_parse: skip zero sized NAL units
Browse files Browse the repository at this point in the history
Avoids extra error checks later on and/or invalid reads.
  • Loading branch information
Nevcairiel committed May 7, 2016
1 parent 5f942f4 commit 336b453
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavcodec/h2645_parse.c
Expand Up @@ -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);
Expand Down

0 comments on commit 336b453

Please sign in to comment.