mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-30 13:50:50 +08:00
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>
(cherry picked from commit fbec157ea0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
e8b1ce8d1b
commit
5c289c932f
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user