lavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit is found.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/188/merge
Mark Thompson 9 years ago committed by Michael Niedermayer
parent c411e90bc3
commit fbec157ea0
  1. 6
      libavcodec/hevc_parse.c

@ -232,10 +232,16 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
++buf;
--length;
if (length < 4) {
if (pkt->nb_nals > 0) {
// No more start codes: we discarded some irrelevant
// bytes at the end of the packet.
return 0;
} else {
av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
return AVERROR_INVALIDDATA;
}
}
}
buf += 3;
length -= 3;

Loading…
Cancel
Save