Commit fbec157e authored by Mark Thompson's avatar Mark Thompson Committed by Michael Niedermayer

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

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent c411e90b
......@@ -232,8 +232,14 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
++buf;
--length;
if (length < 4) {
av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
return AVERROR_INVALIDDATA;
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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment