You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-30 22:24:04 +02: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
bf80b1d88d
commit
d6adcab842
@ -232,10 +232,16 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
|
|||||||
++buf;
|
++buf;
|
||||||
--length;
|
--length;
|
||||||
if (length < 4) {
|
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");
|
av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buf += 3;
|
buf += 3;
|
||||||
length -= 3;
|
length -= 3;
|
||||||
|
Reference in New Issue
Block a user